Hi, is it possible to turn off antialiasing for the
> axes and labels of a plot, or does it affect the data
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 -
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)
objects = (ax.get_xticklines() + ax.get_yticklines() +
ax.get_xgridlines() + ax.get_ygridlines() +
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.