On Thu, May 12, 2011 at 3:42 AM, Johannes Radinger <jradin...@gmx.at> wrote:
> Hello ,
>
> sofar I know how to safe a plot into a *.eps file and it works good,
> but there is one issue with filled areas between two functions.
>
> When I try to use:
> plt.fill_between(x, pdf_min, pdf_max, color='0.85')
>
> and I try to open it on my mac I fail. So far as I know
> is the mac converting the eps internally to pdf to be
> displayed, but it seems it can't be converted.
>
> If I try to set the output to *.pdf it works perfectly and I can
> open the file. Something in the combination of fill_between
> and eps is causing the error. I tried also color="red" but with
> the same problems.
>
> Is there anything I've to set because I need the output as
> a working eps.
>
under the hool, fill_between uses a PolyCollection. Below is a simple
example which uses a PolyCollection directly. Does this crash when you
convert eps -> pdf. If not, maybe we can hone in on what is special about
the vertices in your fill_between example. Also, you should give us some
information about what version of matplotlib and OSX you are running.
import numpy as np
import matplotlib.collections as mcollections
import matplotlib.pyplot as plt
theta = np.linspace(0, 2*np.pi, 20)
x1 = np.cos(theta)
y1 = np.sin(theta)
x2 = x1 + 5
y2 = y1 + 5
verts1 = zip(x1, y1)
verts2 = zip(x2, y2)
c = mcollections.PolyCollection([verts1, verts2], facecolors=['red',
'green'])
ax = plt.subplot(111)
ax.add_collection(c)
ax.axis([-5, 10, -5, 10])
plt.savefig('test.eps')
plt.show()
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users