From: Christian K. <ge...@ho...> - 2004-09-15 10:20:54
|
Hi, is it possible to turn off antialiasing for the axes and labels of a plot, or does it affect the data only? Christian |
From: John H. <jdh...@ac...> - 2004-09-15 13:54:07
|
>>>>> "Christian" == Christian Kristukat <ge...@ho...> writes: Christian> Hi, is it possible to turn off antialiasing for the Christian> axes and labels of a plot, or does it affect the data Christian> only? Yes and no. You can turn off antialiasing by default for all lines and patches (which includes the axes frame since the frame is a Rectangle which derives from Patch in matplotlib.patches) by setting lines.antialiased : False patch.antialiased : False in your matplotlibrc file http://matplotlib.sf.net/.matplotlibrc. You can also do this for an individual script using the rc command - http://matplotlib.sf.net/matplotlib.matlab.html#-rc. If you only want to selectively turn off antialiasing for the axes lines and rectangle, you can set the antialised property to False for all the relevant objects from matplotlib.matlab import * ax = subplot(111) plot([1,2,3]) grid(True) objects = (ax.get_xticklines() + ax.get_yticklines() + ax.get_xgridlines() + ax.get_ygridlines() + [ax.get_frame()] ) set(objects, antialiased=False) show() As for text, assuming you are using one of the *Agg backends, you cannot get aliased text. agg uses the freetype module ft2font for text rendering. Off the top of my head, I don't know if freetype has an aliased option (Anyone?), and I know the matplotlib wrapper doesn't currently support it if it does. You always have the option of using a backend that doesn't support antialiasing (eg wx, ps), but most of them do in some regard; eg gtk uses antialiased text but not lines, I believe. What do you want this feature - is it because it doesn't look nice in printouts of agg PNGs (this has come up before)? If so, and you have a postscript printer, that may be your best bet. You could also try the SVG output, for which there are plugins or programs that would probably know how to send an svg doc to your printer. JDH |
From: Christian K. <ge...@ho...> - 2004-09-15 14:15:49
|
John Hunter wrote: > What do you want this feature - is it because it doesn't look nice in > printouts of agg PNGs (this has come up before)? If so, and you have > a postscript printer, that may be your best bet. You could also try > the SVG output, for which there are plugins or programs that would > probably know how to send an svg doc to your printer. In fact the PNGs are looking too nice. I want to create a GIF animation to be included in a p0werpoint presentation. As p0werpoint automatically does antialiasing for every bitmap graphic it produces ugly results if the bitmap is already antialised. Anyway, it's not that important... Christian |
From: John H. <jdh...@ac...> - 2004-09-15 14:18:46
|
>>>>> "Christian" == Christian Kristukat <ge...@ho...> writes: Christian> In fact the PNGs are looking too nice. I want to create Christian> a GIF animation to be included in a p0werpoint Christian> presentation. As p0werpoint automatically does Christian> antialiasing for every bitmap graphic it produces ugly Christian> results if the bitmap is already antialised. Anyway, Christian> it's not that important... An alternative approach is to save a series of PNGs and use one of many programs on the web to turn a series of images into a mpeg or AVI. Perhaps then powerpoint won't try and be so helpful :-) What does it mean to look "too nice"? I guess that's a feature, not a bug <wink> JDH |
From: Christian K. <ge...@ho...> - 2004-09-15 14:21:28
|
John Hunter wrote: > Christian> In fact the PNGs are looking too nice. I want to create > Christian> a GIF animation to be included in a p0werpoint > Christian> presentation. As p0werpoint automatically does > Christian> antialiasing for every bitmap graphic it produces ugly > Christian> results if the bitmap is already antialised. Anyway, > Christian> it's not that important... > > An alternative approach is to save a series of PNGs and use one of > many programs on the web to turn a series of images into a mpeg or > AVI. Perhaps then powerpoint won't try and be so helpful :-) Yes, that could be an idea. > What does it mean to look "too nice"? I guess that's a feature, not a > bug <wink> Yes, definitely. Christian |
From: Peter G. <pgr...@ge...> - 2004-09-20 21:24:23
|
>> >> An alternative approach is to save a series of PNGs and use one of >> many programs on the web to turn a series of images into a mpeg or >> AVI. Perhaps then powerpoint won't try and be so helpful :-) > > > Yes, that could be an idea. I do this all the time... infact create daily movies of the forces exerted on our primary mirrors during nightly observing.. use mplayer to put the png images together.. results are quite nice... -- Peter Groszkowski Gemini Observatory Tel: +1 808 974-2509 670 N. A'ohoku Place Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA |
From: John H. <jdh...@ac...> - 2004-09-20 21:40:03
|
>>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes: Peter> use mplayer to put the png images together.. results are Peter> quite nice... Can you post the command you use to play the pngs? Can mplayer output an avi or mpg, or does it just animate the images. I saw from the man pages that something like mplayer mf=type=png:fps=25 mf:/filemask is required, but I don't know how to set the filemask of if this is the right approach. I'd like to add some instructions to the FAQ. Thanks, JDH |
From: Eli G. <eg...@se...> - 2004-09-20 21:54:20
|
You can also use ImageMagick. I believe the command is: convert -delay 20 c:/myimages/img*.png c:/myvideo/imgs.mpg Eli ----- Original Message ----- From: "John Hunter" <jdh...@ni...> To: "Peter Groszkowski" <pgr...@ge...> Cc: "Christian Kristukat" <ge...@ho...>; <mat...@li...> Sent: Monday, September 20, 2004 4:50 PM Subject: Re: [Matplotlib-users] turn off antialiasing > >>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes: > > Peter> use mplayer to put the png images together.. results are > Peter> quite nice... > > Can you post the command you use to play the pngs? Can mplayer output > an avi or mpg, or does it just animate the images. > > I saw from the man pages that something like > > mplayer mf=type=png:fps=25 mf:/filemask > > is required, but I don't know how to set the filemask of if this is > the right approach. I'd like to add some instructions to the FAQ. > > Thanks, > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Peter G. <pgr...@ge...> - 2004-09-20 23:49:25
|
Eli Glaser wrote: >You can also use ImageMagick. I believe the command is: > >convert -delay 20 c:/myimages/img*.png c:/myvideo/imgs.mpg > > might also note that to use this you will need to have mpeg2encode installed... ImageMagic does not depend on this directly so you will have to do the install yourself... i initially used 'convert' for my purposes, but it is much more limited than mencoder (ex. frame rates)... peter |
From: Peter G. <pgr...@ge...> - 2004-09-20 21:59:54
|
John Hunter wrote: >>>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes: >>>>> > > Peter> use mplayer to put the png images together.. results are > Peter> quite nice... > > Can you post the command you use to play the pngs? Can mplayer output > an avi or mpg, or does it just animate the images. > i use something like this: mencoder mf://*.png -mf type=png:w=600:h=500:fps=10 -ovc lavc -lavcopts vcodec=wmv2 -oac copy -o animation.avi it creates an avi file as you can probably guess... initially i started to play with animated images (gifs) but they would be waaaay too large for my purposes... ..you can play with lots of settings in the line above... for example the dimensions of your images will probably be different... the codec you use might also vary.. i wanted something that would be usable by many windows users.. (note that with wmv2 some still have to get codec updates).. note that this command will use all the images in the current working directory.. finally, mencoder comes with mplayer.. .the easiest is to do: apt-get install mplayer this will work for debian users, and redhat/fedora (althought you would have to get apt-get first - try here: http://apt.freshrpms.net/ )... -- Peter Groszkowski Gemini Observatory Tel: +1 808 974-2509 670 N. A'ohoku Place Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA |
From: Darren D. <dd...@co...> - 2004-09-20 22:46:47
|
On Monday 20 September 2004 09:56 pm, you wrote: > > ..you can play with lots of settings in the line above... for example > the dimensions of your images will probably be different... the codec > you use might also vary.. i wanted something that would be usable by > many windows users.. (note that with wmv2 some still have to get codec > updates).. note that this command will use all the images in the > current working directory.. > OOOH, I have been avoiding figuring out how to do this sort of work to create movies for my thesis defense. I guess that means I have to graduate. -- Darren Dale |
From: Flavio C. C. <fcc...@ci...> - 2004-09-21 13:23:02
|
A quick google search reveals that someone has already published a tutorial for animating graphs made with matplotlib using mencoder... Check it out: http://web.media.mit.edu/~lifton/code/GraphMovies/ He even provides an example script... Synchronicity... Cheers, Flavio On Mon, 2004-09-20 at 20:50, John Hunter wrote: > >>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes: > > Peter> use mplayer to put the png images together.. results are > Peter> quite nice... > > Can you post the command you use to play the pngs? Can mplayer output > an avi or mpg, or does it just animate the images. > > I saw from the man pages that something like > > mplayer mf=type=png:fps=25 mf:/filemask > > is required, but I don't know how to set the filemask of if this is > the right approach. I'd like to add some instructions to the FAQ. > > Thanks, > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |