From: Kuzminski, S. R <SKu...@fa...> - 2004-03-08 17:08:43
|
Thanks, that worked for the line being plotted, although the legend box and axis are still aliased. Part of my requirements include supporting presentation quality printing. I would like to just use Agg as GD has dependency issues and keeps popping up other problems ( not to mention how great the Agg output looks ). But that great looking anti-aliasing doesn't print well, so ideally there would be a 'global' level flag that controls aliasing ( or not ) for everything drawn. I know when the image is being created for viewing or for printing and so can set the flag accordingly. S -----Original Message----- From: John Hunter [mailto:jdh...@ni...]=20 Sent: Monday, March 08, 2004 8:16 AM To: Kuzminski, Stefan R Cc: mat...@li... Subject: Re: [Matplotlib-users] simple api question >>>>> "Kuzminski," =3D=3D Kuzminski, Stefan R <SKu...@fa...> writes: Kuzminski,> I got the .51 release, looks great. I need to Kuzminski,> set_antialiased() on the Renderer, but I'm not sure Kuzminski,> how to get the renderer object correctly. If I call Kuzminski,> gca() I get the SubPlot, but the renderer member is Kuzminski,> None. Any advice would be appreciated. There is no way to set antialiased on the renderer itself, just on the individual objects (lines etc). =20 plot([1,2,3], antialiased=3DFalse) or=20 lines =3D plot(x1,y1,x2,y2) set(lines, 'antialiased', False) or set lines.antialiased in matplotlibrc to the default you want. Unfortunately, agg does not yet respect antialiased =3D=3D False for all primitives, currently only lines. See also http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC http://matplotlib.sourceforge.net/faq.html#CUSTOM Can you tell me what you're trying to do? JDH |
From: Kuzminski, S. R <SKu...@fa...> - 2004-03-09 17:23:43
|
The GD output looks good when printed, maybe I will switch between the 2 ( Agg for display, GD for printing ). The Agg un-aliased lines don't come out quite as well, they seem to render more of the pixels for each point on the line. Nice to have the different backend options. S =20 -----Original Message----- From: John Hunter [mailto:jdh...@ni...]=20 Sent: Monday, March 08, 2004 8:37 AM To: Kuzminski, Stefan R Cc: mat...@li... Subject: Re: [Matplotlib-users] simple api question >>>>> "Kuzminski," =3D=3D Kuzminski, Stefan R <SKu...@fa...> writes: Kuzminski> Thanks, that worked for the line being plotted, Kuzminski> although the legend box and axis are still aliased. Kuzminski> Part of my requirements include supporting Kuzminski> presentation quality printing. I would like to just Kuzminski> use Agg as GD has dependency issues and keeps popping Kuzminski> up other problems ( not to mention how great the Agg Kuzminski> output looks ). But that great looking anti-aliasing Kuzminski> doesn't print well, so ideally there would be a Kuzminski> 'global' level flag that controls aliasing ( or not ) Kuzminski> for everything drawn. I know when the image is being Kuzminski> created for viewing or for printing and so can set the Kuzminski> flag accordingly. I'll work on getting the rest of the objects to respect the antialiased flag. You can control antialiasing for all lines globally with rcParams http://matplotlib.sourceforge.net/faq.html#CUSTOM JDH |
From: John H. <jdh...@ac...> - 2004-03-09 17:41:19
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes: Stephan> The GD output looks good when printed, maybe I will Stephan> switch between the 2 ( Agg for display, GD for Stephan> printing ). The Agg un-aliased lines don't come out Stephan> quite as well, they seem to render more of the pixels Stephan> for each point on the line. Nice to have the Stephan> different backend options. This has to do with how agg handles subpixel positioning - I've emailed the agg list and gotten some advice but haven't come up with a good system to make the lines appear the same thickness in the aliased and antialiased cases. I'm still working on it. In the meantime, here is a little backend magic that will make it easier for you to print to your backend of choice. This example displays the image in the default GUI (GTKAgg for me) and prints with GD. from matplotlib.backends.backend_gd import FigureCanvasGD from matplotlib.matlab import * plot([1,2,3]) manager = get_current_fig_manager() canvasgd = manager.canvas.switch_backends(FigureCanvasGD) canvasgd.print_figure('gdfig') show() print_figure takes the same args as savefig. gd has a pesky color allocation bug that I haven't figured out that you may bump into. JDH |
From: John H. <jdh...@ac...> - 2004-03-08 17:16:15
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes: Kuzminski> Thanks, that worked for the line being plotted, Kuzminski> although the legend box and axis are still aliased. Kuzminski> Part of my requirements include supporting Kuzminski> presentation quality printing. I would like to just Kuzminski> use Agg as GD has dependency issues and keeps popping Kuzminski> up other problems ( not to mention how great the Agg Kuzminski> output looks ). But that great looking anti-aliasing Kuzminski> doesn't print well, so ideally there would be a Kuzminski> 'global' level flag that controls aliasing ( or not ) Kuzminski> for everything drawn. I know when the image is being Kuzminski> created for viewing or for printing and so can set the Kuzminski> flag accordingly. I'll work on getting the rest of the objects to respect the antialiased flag. You can control antialiasing for all lines globally with rcParams http://matplotlib.sourceforge.net/faq.html#CUSTOM JDH |