Hi
thanks A LOT for taking the time to test this and for the suggestions.

Yes, pcolormesh is needed (or at least I think) because in the "real"
example (the figures I am trying to make) the pixels are rotated meaning
that these are polygons which are not aligned with the axes. Imshow
cannot do that as far as I can tell because it shows a rectangular grid
(masked or not) aligned with the axis.

It seems indeed linked with the number of plots/memory. I have tested
this now and looked for when it crashes, Limiting the number of rows to
1, 2 , 3 etc. With 3 rows (9 plots) it works. But it crashes when I
include 4 rows. Looking at a "top" and memory usage, it is clearly a pb
with ghostscript when it takes over to transform it into the eps. Here
is the line from the "top" when it crashes:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 5980 emsellem  20   0  167m  88m 4352 R  100  2.3   0:54.45 gs

When gs go over ~170m, it crashes. Not clue why. I have ample memory
left (2Gb RAM, 2Gb Swap) and no pb of disk space.

As for the workarounds: yes I did a pdf2ps already for one urgent figure
I had to get. I just hoped that I wouldn't have to do that for all my
figures.

Never used rasterization before...
(and thanks for pointing out the mistake on map3, this came after
adapting the script for this post). I guess this means you transform it
into a resolution dependent figure. I can try it but I am afraid this
will look quite bad.

cheers
Eric


On 09/01/10 04:25, Jae-Joon Lee wrote:
> I can reproduce this error with the current svn.
> 
> I doubt if this is a matplotlib issue, because it works fine if the
> number of axes is small.
> To me, it seems as some memory error in the ghostscript, but my quick
> googling did not show any relevant information.
> So, I hope some postscript expert take a look at the issue.
> 
> However, note that pcolormesh in backends other than agg is extremely
> inefficient, and I strongly discourage its use in other backends.
> Your current example could be much efficient if you simply can use
> imshow. Do you have to use pcolormesh? Your current example seems to
> be easily convertible to imshow, but you original example may not.
> 
> In case the use of pcolormesh is not avoidable, I can think of two 
> workarounds.
> 
> 1) save as pdf first then convert to eps. Saving as pdf will take as
> much time as saving as ps.
> 
> 2) Save as eps but rasterize the pcolormesh plots. This is my choice
> and saving time is also not very long. As a matter of fact, whenever
> pcolormesh is used, I strongly recommend to consider rasterizing it.
> 
> For your current script, you may add something like below at the end
> of your for-loop.
> 
>   map1.set_zorder(0.5)
>   map2.set_zorder(0.5)
>   map3.set_zorder(0.5)
>   ax1.set_rasterization_zorder(0.6)
>   ax2.set_rasterization_zorder(0.6)
>   ax3.set_rasterization_zorder(0.6)
> 
> This code needs to be inside the for-loop so that all the pcolormesh
> plots get rasterized.
> Also, note that, in your current script, the third pcolormesh plot is
> assigned to "map2", instead of "map3", so you need to fix this first.

-- 
=================================================================
Eric Emsellem                       European Southern Observatory
                                        Karl-Schwarzschild Str. 2
e-mail: eemse...@eso.org              85748 Garching bei Muenchen
tel: +49 (0)89 3200 6914                                  Germany
fax: +49 (0)89 3200 6480
=================================================================

------------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to