From: ayuffa <ay...@gm...> - 2010-05-20 06:06:44
|
Yes, it's true that uncommenting path.simplify : False line inside the matplotlibrc file fixes the artifacts. However, it also produces HUGE PDF/EPS file sizes. Perhaps, it's better to change path.simplify parameter as needed inside the code via: import matplotlib.pyplot as plt plt.rcParams['path.simplify'] = False # Plotting Code Block goes here plt.rcdefaults() Does anyone have another fix for this problem that DOES NOT produce HUGE PDF/EPS files? efiring wrote: > > Jouni K. Seppänen wrote: >> Jordan Dawe <jd...@eo...> writes: >> >>> Contourf plots that I output in vector format files have little >>> triangular glitches at the contour boundaries if the contoured array >>> is larger than about 200x200. The same files in png format are >>> perfect, even at very high dpi values. >> >> The current svn trunk doesn't have the really jarring little triangles >> (at least in the pdf output), but there are still several very obtuse >> white triangles between the regions. Rasterization at a high dpi makes >> the output somewhat better at the cost of larger output files: >> >> c=contourf(X, Y, Z, 10) >> axis((-3, 3, -3, 3)) >> savefig('unrasterized.pdf') >> for d in c.collections: >> d.set_rasterized(True) >> savefig('rasterized.pdf',dpi=200) > > > At least in the trunk--and maybe in 0.99.0--the problem is caused by > path simplification. In the trunk, for the eps file, it goes away > completely if I use a matplotlibrc with > > path.simplify : False > > In the trunk, what seems to be happening is that when a contour boundary > is almost straight, but has an inflection point, the curves for the > adjacent patch boundaries are simplified slightly differently. This is > not surprising; if nothing else, the path will be traveled in a > different direction when it is an outer boundary than when it is an > inner boundary (for a set of concentric boundaries). > > Jordan, try using a local matplotlibrc with the above. Unless you are > already customizing via a local matplotlibrc, that line is all you need. > > One reason the trunk behavior differs from 0.99.0 is that contour patch > boundaries are now being turned into compound boundaries instead of > using a branch cut to connect the outside path to the inside path. I > suspect simplification is causing the artifacts in both cases, though. > > Eric > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/eps-pdf-svg-contourf-contours-don%27t-overlap-properly-with-high-resolution-data-tp26982883p28617537.html Sent from the matplotlib - users mailing list archive at Nabble.com. |