Juan Fiol | 1 May 01:58
Picon
Favicon

Re: margins in figures


Thanks Ryan, just what I needed.
Juan

--- On Thu, 4/30/09, Ryan May <rmay31@...> wrote:

> From: Ryan May <rmay31@...>
> Subject: Re: [Matplotlib-users] margins in figures
> To: fiolj@...
> Date: Thursday, April 30, 2009, 9:59 PM
> On Thu, Apr 30, 2009 at 3:46 PM, Juan Fiol
> <fiolj@...> wrote:
> 
> >
> > Hi, I am trying to control the amount of margin (white
> space) around the
> > figures (mainly for savefig) but could not find any
> information. Any tips?
> 
> 
> 
> Look at pyplot.subplots_adjust()
> 
> Ryan
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
(Continue reading)

Gert-Jan | 1 May 11:31
Picon

Re: Manually enable export as EMF


Hello again,

Thanks for the reply! I did some more testing, but I couldn't get it to work
yet. However, during the testing, I got the idea that I was wrong about what
backends do; it appears they are only used for creating plots, not for
saving them. For example:

> #!/usr/bin/env python
> 
> import matplotlib
> matplotlib.use('module://backend_emf')
> from pylab import *
> 
> x = [0,1,2,3]
> y = [4,3,2,1]
> 
> figure()
> plot(x,y)
> savefig('C:\\test.emf')
> 

This still results in a NotImplemented error. Trying to save as another file
type (savefig(C':\\test.pdf') for example) won't work anymore, either.
Trying to save as PDF, for example, gives this error message:

> ValueError: Format "pdf" is not supported.
> Supported formats: emf.
> 

(Continue reading)

Michael Droettboom | 1 May 14:29

Re: Polar plotting clockwise and rotated

To emulate the current behavior (which doesn't try to interpolate 
between points) you can pass "resolution=1" to the polar command.  But I 
agree with Eric -- it sounds like updating my resolve this issue.

Mike

Eric Firing wrote:
> Ng, Enrico wrote:
>   
>> The rotation and resetting of the labels isn't a big issue.
>> The issues is when I reverse the direction.  Matplotlib seems to only
>> want to plot in an anti-clockwise direction.  I can transform the data
>> to be backwards so that it looks ok,  however when it tries to connect
>> the start and end points, it goes back around and draws a circle instead
>> of just connecting the two points using a straight line. 
>>     
>
> What version of mpl are you using?  This sounds like behavior that is 
> not current.
>
> Eric
>
>   
>> On Tuesday 21 April 2009 08:36:35 Michler, Matthias wrote:
>> Hi Enrico,
>>
>> I'm afraid that this functionality is missing in matplotlib, but I'm not
>> an
>> expert so there is still hope that this can be easily achieved.
>>
(Continue reading)

Michael Droettboom | 1 May 14:28

Re: Manually enable export as EMF

Gert-Jan wrote:
> Hello again,
>
> Thanks for the reply! I did some more testing, but I couldn't get it to work
> yet. However, during the testing, I got the idea that I was wrong about what
> backends do; it appears they are only used for creating plots, not for
> saving them. For example:
>
>
>
>   
>> #!/usr/bin/env python
>>
>> import matplotlib
>> matplotlib.use('module://backend_emf')
>> from pylab import *
>>
>> x = [0,1,2,3]
>> y = [4,3,2,1]
>>
>> figure()
>> plot(x,y)
>> savefig('C:\\test.emf')
>>
>>     
>
> This still results in a NotImplemented error. Trying to save as another file
> type (savefig(C':\\test.pdf') for example) won't work anymore, either.
> Trying to save as PDF, for example, gives this error message:
>
(Continue reading)

Gert-Jan | 1 May 15:24
Picon

Re: Manually enable export as EMF


Michael Droettboom-3 wrote:
> 
> Can you be more specific about why that doesn't work?
> 

Trying to save a plot as, for example, 'image.emf' makes an error message
pop up. This error dialog has the title 'Error saving file', but does not
have any error message in its body.
I hope that is what you mean?

Michael Droettboom-3 wrote:
> 
> What GUI backend are you using?  That sounds like a bug in how the file
> selection dialog is being used.
> 

I'm using the Qt4 backend in my application, though the code examples I gave
are created and executed without any GUI backend.

To see this for yourself you could run this example code:

> from pylab import *
> 
> x = [0,1,2,3]
> y = [4,3,2,1]
> 
> figure()
> plot(x,y)
> show()
(Continue reading)

Gideon Simpson | 1 May 16:14
Picon
Favicon

Floating point exception

When I try to plot some data, I get:

Floating point exception

How can I track down what's wrong?

-gideon

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
Michael Droettboom | 1 May 16:25

Re: Floating point exception

Can you provide a stand along script that reproduces the problem?

Mike

Gideon Simpson wrote:
> When I try to plot some data, I get:
>
> Floating point exception
>
> How can I track down what's wrong?
>
> -gideon
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations 
> Conference from O'Reilly Media. Velocity features a full day of 
> expert-led, hands-on workshops and two days of sessions from industry 
> leaders in dedicated Performance & Operations tracks. Use code vel09scf 
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

--

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
(Continue reading)

Thomas Robitaille | 1 May 16:46
Picon
Gravatar

Enforcing common view limits

Hello,

I want to create two sets of axes for a figure that would be  
equivalent to

ax = fig.add_subplot(111)
ax2 =  
ax 
.figure 
.add_axes(ax.get_position(True),frameon=False,sharex=ax,sharey=ax)

except that I want to be able to specify different tick locators and  
formatters for ax and ax2. If I remove sharex and sharey, then there  
is no guarantee that both axes have the same view limits. I want to  
enforce common view limits while retaining the independence that would  
allow me to specify different locators/formatters.

I would welcome any advice on how to do this,

Thanks!

Thomas

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
(Continue reading)

Ng, Enrico | 1 May 16:46
Favicon

Re: Polar plotting clockwise and rotated

I am using the 0.98.5

That works for me too but its gets messed up if I modify theta in order
to rotate the graph

Theta = pi/2 - theta
will cause the circles to appear

If I modify r, then it works ok

-----Original Message-----
From: Eric Firing [mailto:efiring@...] 
Sent: Friday, May 01, 2009 2:14 AM
To: Ng, Enrico
Subject: Re: [Matplotlib-users] Polar plotting clockwise and rotated

With mpl from svn (and using ipython -pylab), the following works:

rr = rand(36)
r = np.hstack((rr, [rr[0]]))
theta = linspace(0, 2*pi, 37)
polar(theta, r)

Eric

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
(Continue reading)

Eric Firing | 1 May 19:23
Favicon
Gravatar

Re: imshow: large eps-files

Peter Pippan wrote:
> Hi,
> 
> I was wondering about the eps output produced by imshow().
> 
> This program
> ----------------------------------------------
> from pylab import *
> Z = rand(10,10)
> imshow(Z,interpolation='nearest',cmap=cm.bone)
> savefig('bone.eps')
> imshow(Z,interpolation='nearest',cmap=cm.gray)
> savefig('gray.eps')
> ----------------------------------------------
> produces files with sizes of
> 11M and 172K for bone.eps and gray.eps
> respectively.

With svn, I get nearly the same size for both, and intermediate between 
your two:

-rw------- 1 efiring efiring  1413040 2009-05-01 07:19 bone.eps
-rw------- 1 efiring efiring  1407313 2009-05-01 07:19 gray.eps

> 
> Does anybody know why the difference is that large?
> I would expect a factor of 3 for RGB or 4 if an alpha channel is
> included, but not a factor of about 60.

Yes, it's bizarre.  I have no idea what was going on.  Fortunately, it 
(Continue reading)


Gmane