and can go to the menu and "Copy Figure" and paste it into Micro$hit Word, but i can't find a way to export that to .png or .svg either. i'm trying to upload some math function graphs into Wikipedia and i can't, for the life of me, figger out gnuplot. r b-j
how do i get MATLAB 5 to export a "Figure" to PNG or SVG?
Started by ●August 18, 2006
Reply by ●August 19, 20062006-08-19
rbj@audioimagination.com writes:> and can go to the menu and "Copy Figure" and paste it into Micro$hit > Word, but i can't find a way to export that to .png or .svg either. > i'm trying to upload some math function graphs into Wikipedia and i > can't, for the life of me, figger out gnuplot.In Matlab, after plotting the figure, enter in the command window: print -dpng 'prob3ef.eps' -- % Randy Yates % "The dreamer, the unwoken fool - %% Fuquay-Varina, NC % in dreams, no pain will kiss the brow..." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Eldorado Overture', *Eldorado*, ELO http://home.earthlink.net/~yatescr
Reply by ●August 19, 20062006-08-19
Randy Yates wrote:> rbj@audioimagination.com writes: > > > and can go to the menu and "Copy Figure" and paste it into Micro$hit > > Word, but i can't find a way to export that to .png or .svg either. > > i'm trying to upload some math function graphs into Wikipedia and i > > can't, for the life of me, figger out gnuplot. > > In Matlab, after plotting the figure, enter in the command window: > print -dpng 'prob3ef.eps'oooh, oooh, i have to try that. i'll report how this undocumented feature works. i presume it should be 'prob3ef.png' instead of 'prob3ef.eps'. i did see something like this for eps, but i couldn't believe this PC with micro$hit office couldn't even deal with encapsulated postscript. this missing format crap should have been dealt with more than a decade ago. r b-j
Reply by ●August 19, 20062006-08-19
"robert bristow-johnson" <rbj@audioimagination.com> writes:> Randy Yates wrote: >> rbj@audioimagination.com writes: >> >> > and can go to the menu and "Copy Figure" and paste it into Micro$hit >> > Word, but i can't find a way to export that to .png or .svg either. >> > i'm trying to upload some math function graphs into Wikipedia and i >> > can't, for the life of me, figger out gnuplot. >> >> In Matlab, after plotting the figure, enter in the command window: >> print -dpng 'prob3ef.eps' > > oooh, oooh, i have to try that. i'll report how this undocumented > feature works. i presume it should be 'prob3ef.png' instead of > 'prob3ef.eps'. i did see something like this for eps, but i couldn't > believe this PC with micro$hit office couldn't even deal with > encapsulated postscript.From what I've seen, EPS and MicroSnot Office aren't good friends. MicroSnot much prefers things like jpegs, bmps, wmf's, etc. EPS requires a (gasp!) postscript interpreter. -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC % she does the things you do, %%% 919-577-9882 % but she is an IBM." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Reply by ●August 19, 20062006-08-19
Randy Yates wrote:> "robert bristow-johnson" <rbj@audioimagination.com> writes: > > > Randy Yates wrote: > >> rbj@audioimagination.com writes: > >> > >> > and can go to the menu and "Copy Figure" and paste it into Micro$hit > >> > Word, but i can't find a way to export that to .png or .svg either. > >> > i'm trying to upload some math function graphs into Wikipedia and i > >> > can't, for the life of me, figger out gnuplot. > >> > >> In Matlab, after plotting the figure, enter in the command window: > >> print -dpng 'prob3ef.eps' > > > > oooh, oooh, i have to try that. i'll report how this undocumented > > feature works. i presume it should be 'prob3ef.png' instead of > > 'prob3ef.eps'. i did see something like this for eps, but i couldn't > > believe this PC with micro$hit office couldn't even deal with > > encapsulated postscript. > > From what I've seen, EPS and MicroSnot Office aren't good friends. MicroS=not> much prefers things like jpegs, bmps, wmf's, etc. EPS requires a (gasp!) > postscript interpreter.bad news. (maybe it's because it's MATLAB 5 and not 6 or 7.) =BB clear; =BB t =3D linspace(-4, 4, 8193); =BB theta =3D 0; =BB plot(t, 1/cos(theta)*cos(pi*t+theta)); =BB hold on; =BB theta =3D pi/4; =BB plot(t, 1/cos(theta)*cos(pi*t+theta), 'r'); =BB theta =3D -pi/3; =BB plot(t, 1/cos(theta)*cos(pi*t+theta), 'g'); =BB s =3D linspace(-4, 4, 9); =BB plot(s, cos(pi*s), 'ko'); =BB axis([-4 4 -3 3]); =BB print -dpng 'cfalias.png' Illegal device option, -dpng, specified. Supported devices are: -dps -dpsc -dps2 -dps2c -dpsc2 -deps -deps -depsc -deps2 -deps2c -depsc2 -dhpgl -dill -dmfile -dlaserjet -dljetplus -dljet2p -dljet3 -dcdeskjet -dcdjcolor -dcdjmono -ddeskjet -dcdj550 -ddjet500 -dpaintjet -dpjetxl -dpjxl -dpjxl300 -dcdj500 -ddnj650c -dbj10e -dbj200 -dbjc600 -depson -depsonc -deps9high -dibmpro -dln03 -dtifflzw -dtiffpack -dpcxmono -dpcx16 -dpcx256 -dpcx24b -dbmp16m -dbmp256 -dpbm -dpbmraw -dpgm -dpgmraw -dppm -dppmraw -dbit -dbitcmyk -dbitrgb -dsgirgb -dwin -dwinc -dmeta -dbitmap -dsetup -dgifmono ??? Error using =3D=3D> print so MATLAB 5 doesn't speak PNG. i'm trying to create a simple and uncluttered drawing of why sampling at precisely twice the highest frequency of content still ain't good enough (it has to be strictly higher than twice the highest frequency of content). and i wanna upload this to Wikipedia and put it in the article on the sampling theorem. can anybody take the script above and turn it into a .png or .svg image? i s'pose even a .gif would do, but they frown on it. of course teaching a man to fish is better than giving him a fish, but i'm starving at the moment. r b-j
Reply by ●August 19, 20062006-08-19
"robert bristow-johnson" <rbj@audioimagination.com> writes:> Randy Yates wrote: >> "robert bristow-johnson" <rbj@audioimagination.com> writes: >> >> > Randy Yates wrote: >> >> rbj@audioimagination.com writes: >> >> >> >> > and can go to the menu and "Copy Figure" and paste it into Micro$hit >> >> > Word, but i can't find a way to export that to .png or .svg either. >> >> > i'm trying to upload some math function graphs into Wikipedia and i >> >> > can't, for the life of me, figger out gnuplot. >> >> >> >> In Matlab, after plotting the figure, enter in the command window: >> >> print -dpng 'prob3ef.eps' >> > >> > oooh, oooh, i have to try that. i'll report how this undocumented >> > feature works. i presume it should be 'prob3ef.png' instead of >> > 'prob3ef.eps'. i did see something like this for eps, but i couldn't >> > believe this PC with micro$hit office couldn't even deal with >> > encapsulated postscript. >> >> From what I've seen, EPS and MicroSnot Office aren't good friends. MicroSnot >> much prefers things like jpegs, bmps, wmf's, etc. EPS requires a (gasp!) >> postscript interpreter. > > bad news. (maybe it's because it's MATLAB 5 and not 6 or 7.)Yeah, must be the version 5. Octave 2.9.5 works, but in the mean time, eat: http://home.earthlink.net/~yatescr/cfalias.png -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by ●August 19, 20062006-08-19
Randy Yates wrote:> > Yeah, must be the version 5. Octave 2.9.5 works, but in the mean > time, eat: > > http://home.earthlink.net/~yatescr/cfalias.pngthanks, Randy. but, even when i'm starving, i's still a picky eater. did Octave do this? it looks different than ML. can you make the cosine curve (the one with the lowest amplitude) blue (that was the default color for ML plots) and put in little circles instead of little crosses at the intersections? doesn't matter. there is already a drawing there but the guy put in dozens of different phases, cluttering it up, and it looks to me that three or four different phases will get the idea across just fine.> -- > % Randy Yates % "Watching all the days go by... > %% Fuquay-Varina, NC % Who are you and who am I?" > %%% 919-577-9882 % 'Mission (A World Record)', > %%%% <yates@ieee.org> % *A New World Record*, ELO > http://home.earthlink.net/~yatescr
Reply by ●August 19, 20062006-08-19
"robert bristow-johnson" <rbj@audioimagination.com> writes:> Randy Yates wrote: >> >> Yeah, must be the version 5. Octave 2.9.5 works, but in the mean >> time, eat: >> >> http://home.earthlink.net/~yatescr/cfalias.png > > thanks, Randy. but, even when i'm starving, i's still a picky eater.Sheesh, Robert! If I didn't love you...> did Octave do this?Yup.> it looks different than ML.Yeah, I didn't notice that the first time. Octave does differ from Matlab in these types of annoying ways. Try it again (hit reload on your browser to clear the cache): http://home.earthlink.net/~yatescr/cfalias.png -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC % she does the things you do, %%% 919-577-9882 % but she is an IBM." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Reply by ●August 19, 20062006-08-19
Randy Yates wrote:> > Sheesh, Robert! If I didn't love you...hey, but what good is love if we can't take it for granted?> > did Octave do this? > > Yup. > > > it looks different than ML. > > Yeah, I didn't notice that the first time. Octave does differ > from Matlab in these types of annoying ways. > > Try it again (hit reload on your browser to clear the cache): > > http://home.earthlink.net/~yatescr/cfalias.pngmmmm. num. hit the spot. now, Randy, you agree to release all rights to this SOB, right? because that's the only way i can upload it to Wikimedia Commons. BTW, Octave is free? i'm using a PC of recent (we don't need to call the Weather Service to tell them that hell is freezing over) so, i s'pose i can download it. any particular place or do i just google it to find out? r b-j
Reply by ●August 19, 20062006-08-19
"robert bristow-johnson" <rbj@audioimagination.com> writes:> now, Randy, you agree to release all rights to this SOB, right? > because that's the only way i can upload it to Wikimedia Commons.No, it's mine - ALL MINE ... Mwah ha ha ha ha ha haaaaaaa...........> BTW, Octave is free?Yeah. Well, it'll cost you the hard drive space to store it on.> i'm using a PC of recent (we don't need to call > the Weather Service to tell them that hell is freezing over)And who said miracles were just for the Apostolic age?> so, i s'pose i can download it. any particular place or do i just > google it to find out?http://www.gnu.org/software/octave/ Hmmm. I took a look at the download page and they have two Windoze versions: one if you have cygwin installed and one if you don't. And the one sans cygwin is out-of-date by quite a few versions. Even though it's a pain in the tush, I'd download and install cygwin first just so you can get the latest version. Or, if you're really insane, you could install the Host/Windows Guest/Linux flavor of VMWare, install a nifty linux distro into the virtual machine, THEN install the linux version of octave. Of course the smartest thing to do is completely toss MicroSnot and install linux (I like Fedora Core 4). I have the Host/Linux Guest/Windows 2000 version of VMWare installed so I still get the best of both worlds. -- % Randy Yates % "Midnight, on the water... %% Fuquay-Varina, NC % I saw... the ocean's daughter." %%% 919-577-9882 % 'Can't Get It Out Of My Head' %%%% <yates@ieee.org> % *El Dorado*, Electric Light Orchestra http://home.earthlink.net/~yatescr






