For the issue and examples below, I was using matplotlib 1.0.1. After
upgrading to matplotlib 1.1.0 the issue is fixed.
Best /Chris
On Saturday, March 10, 2012 10:46:52 PM UTC+1, Chris wrote:
>
> Hi,
>
> Spyder seems to have a couple issues with taking control of figure
> properties without asking. Any ideas as to how to avoid these issues?
>
> 1) I've noticed that when plotting from Spyder via an ipython or python
> console, the figure size is limited to 12 inches wide by 6.725 inches tall
> (see below example script), when using the default dpi (different dpi
> changes the maximums). When running the script directly from python or
> ipython command line, the maximum height is not reached and goes to 8
> inches tall as specified in the script.
>
> from pylab import *
>
> figs = []
>
> w = 5
>
> h = 5
>
> for i in xrange(4):
>
> figs.append(figure(figsize=(w, h)))
>
> plot([1,2,3],[6,4,2])
>
> h = h+1
>
> show()
>
> for each in figs:
>
> print each.get_size_inches()
>
> The output is:
> [ 5. 5.]
> [ 5. 6.]
> [ 5. 6.725]
> [ 5. 6.725]
>
> 2) A seemingly related issue-
> Running the following in Spyder:
>
> from pylab import *
>
> fig=figure(figsize=(5,5))
>
> plot([1,2,3],[6,4,2])
>
> show()
>
> fig.get_size_inches()
>
>
> ...gives a square figure window and the console output as expected:
>
> [ 5. 5.]
>
>
> However, running the following which specifies a different dpi:
>
>
> from pylab import *
>
> fig=figure(figsize=(5,5), dpi=50)
>
> plot([1,2,3],[6,4,2])
>
> show()
>
> print fig.get_size_inches()
>
>
> ...gives a rectangular figure window and the console output:
>
> [ 6.46 5. ]
>
>
> So Spyder does not seem to be handling the dpi properly.
>
>
> I tried it with Spyder 2.0.12 and the latest 2.1.8.
>
>
> In the 2nd example with dpi, running directly from ipython or python
> command line gives square figures but with reported dimensions slightly
> larger than 5x5 inches. Adding these 2 lines to the start of the scripts:
>
> import matplotlib as mpl
>
> mpl.use('QT4Agg')
>
> ...makes it give 5x5 inches for both figures. (Adding those 2 lines to the
> start when running from Spyder has not effect since Spyder consoles have
> already chosen QT4Agg as the GUI backend.
>
>
> Best,
>
> Chris
>
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/spyderlib/-/jJSBiCxw9EEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/spyderlib?hl=en.