[Matplotlib-users] matplotlib save image as postscript, when xlabel is saved as text and not path

2014-11-01 Thread oren
How can I save a matplotlib figure with text as a postscript image and that the text will be saved as text. Currently when I save the image as postscript all the text in the image ( xlabel, ylabel etc.. ) is saved as path and not as text.. Is it possible to save it as text? If I use the following

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Benjamin Root
Jerzy, I really do not wish to get into an argument with you. This seems to happen every time you come onto this mailing list. If "winning" this argument is so important to you, then you may have it. I will not continue to split hairs with you. Thank you for mentioning the concept of implicit sur

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Jerzy Karczmarczuk
Le 01/11/2014 20:34, Benjamin Root a écrit : Actually, my response is still completely valid. You can only plot surfaces that can be represented parametrically in two dimensions. Find me a single plotting library that can do differently without having to get to this final step. 1. I did not

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Indeed, it works also for me with Python 3.3.5. Could you explain the changes you made and the reasons behind the byte/string encoding ? Best regards, 2014-11-01 17:21 GMT+01:00 Scott Lasley : > This works for me with python 3.4.2 > > import matplotlib.pyplot as plt > from io import BytesIO > i

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Many Thanks for your support. It is Python 3.3.5 and matplotlib 1.4.0 I've also found that it worked with ByteIO(), but then I was stuck by the encode/decode things. Thanks very much ! The traceback is below: Traceback (most recent call last): File "", line 1, in runfile('/home/hash/exa

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Peter Kerpedjiev
Hi Jerzy and Ben, Thanks for you answers! I must say that although Ben is right in principle, Jerzy's answer is exactly what I was looking for. Even if matplotlib can't do it by itself, there appears to be other libraries that do the heavy lifting and return a set of triangles which can then

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Benjamin Root
Jerzy, Actually, my response is still completely valid. You can only plot surfaces that can be represented parametrically in two dimensions. Find me a single plotting library that can do differently without having to get to this final step. For matplotlib, it is up to the user to get the data to t

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Jerzy Karczmarczuk
Le 01/11/2014 19:21, Benjamin Root answers the query of Peter Kerpedjiev, who wants to plot (with Matplotlib) the surface of an implicit surface (at least it was his presented example). Your comment "of course, plotting a sphere can be done in spherical coordinates" is actually the right tho

Re: [Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Benjamin Root
Generally speaking, a plottable 3D surface can be represented parametrically in 2D (hence why it is a surface). Your point cloud can not be represented parametrically in 2 dimensions, hence why you are having difficulty figuring out how to plot it as a surface. I used to have similar problems with

Re: [Matplotlib-users] Structure of contour object returned from tricontourf

2014-11-01 Thread Hartmut Kaiser
> On 26 October 2014 00:18, Hartmut Kaiser wrote: > At this point we assume, that polys[0] is a linear ring to be interpreted > as > a polygon exterior and polys[1:] are the corresponding interiors for > polys[0]. > > Here are our questions: > > Is this assumption correct? > Is there any detaile

[Matplotlib-users] plot arbitrary 3D surface

2014-11-01 Thread Peter Kerpedjiev
Hi, I'm trying to plot an outline of an arbitrary 3D shape using matplotlib's plot_surface, and I wanted to ask if any one has any ideas as to how to do it. Here's the beginnings of a simple example: # create a grid resolution = 10 xs = np.linspace(-1,1,resolution) ys = np.linspace(-1,1,resolu

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Scott Lasley
This works for me with python 3.4.2 import matplotlib.pyplot as plt from io import BytesIO import base64 fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) sio = BytesIO() fig.savefig(sio, format="png") html = """ """.format(base64.encodebytes(sio.getvalue()).decode()) For python

Re: [Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Benjamin Root
Please post the entire traceback so that we can know the context of the error message. Also, exactly which versions of matplotlib and python are you using? Ben Root On Sat, Nov 1, 2014 at 7:37 AM, Julien Hillairet wrote: > Dear all, > > I'm trying to write a html page content in which a png fig

[Matplotlib-users] savefig and StringIO error on Python3

2014-11-01 Thread Julien Hillairet
Dear all, I'm trying to write a html page content in which a png figure is generated by matplotlib, with Python3. However, the following piece of code does not work with matplotlib/Python3 (while it should work with Python2). The error is the following on TypeError: string argument expected, got