Re: [Matplotlib-users] plots do not scale to size

2011-02-02 Thread Daniel Mader
Hi, I'd very much vote for such a feature, too. It's absolutely not
foolproof currently the way it is :(
What I find weird, too, is that while everthing fits on the canvas for PDF
output, the left side is cropped for PNG.
´
Best regards,
Daniel
2011/2/1 Paul Anton Letnes wrote:


 On 10. juni 2009, at 14.53, John Hunter wrote:

  On Wed, Jun 10, 2009 at 1:58 AM, Paul Anton
  Letnes wrote:
 
  This _must_ be a bug. Consider the following:
  ##
  import matplotlib
 
  No it is not a bug -- mpl is doing what you tell it to do.  Consider
 
  figure()
  subplot(111)
  plot([1,2,3])
  xlabel('hi mom', fontsize=100)
 
  Each command has precise meaning -- the fig creates a figure using the
  default size, the subplot occupies a fraction of that figure according
  to the default ratios in the subplots_adjust parameters, and the
  xlabel makes a label at an indicated physical size.  You may not be
  explicitly setting those sizes, but they are all defined via defaults
  in the matplotlibrc.  We try and make mpl do what you tell it to do,
  not to try and out-smart you and do what we think you are telling it
  to do.
 
  Now I definitely support the idea that we should have a *feature* to
  auto-adjust the subplots_adjust params and fontsizes so that it just
  works more often.  But this should be an optional feature so the user
  who wants to express their intent clearly will not constantly be
  stymied by mpl adjusting the sizes.  Michael Droettboom has worked on
  it and it is a difficult problem to get right.
 
  JDH

 I don't mean to bother people with this question again, but has anyone
 implemented this auto-adjust feature that John was talking about? It would
 be nice not having to adjust matplotlib.rcParams['figure.subplot.left'] (and
 friends) in every plot script, or alternatively, through a clever hierarchy
 of matplotlibrc files.

 By the way: kudos to matplotlib in every other respect!

 Cheers
 Paul

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plots do not scale to size

2011-02-01 Thread Paul Anton Letnes

On 10. juni 2009, at 14.53, John Hunter wrote:

 On Wed, Jun 10, 2009 at 1:58 AM, Paul Anton
 Letnespaul.anton.let...@gmail.com wrote:
 
 This _must_ be a bug. Consider the following:
 ##
 import matplotlib
 
 No it is not a bug -- mpl is doing what you tell it to do.  Consider
 
 figure()
 subplot(111)
 plot([1,2,3])
 xlabel('hi mom', fontsize=100)
 
 Each command has precise meaning -- the fig creates a figure using the
 default size, the subplot occupies a fraction of that figure according
 to the default ratios in the subplots_adjust parameters, and the
 xlabel makes a label at an indicated physical size.  You may not be
 explicitly setting those sizes, but they are all defined via defaults
 in the matplotlibrc.  We try and make mpl do what you tell it to do,
 not to try and out-smart you and do what we think you are telling it
 to do.
 
 Now I definitely support the idea that we should have a *feature* to
 auto-adjust the subplots_adjust params and fontsizes so that it just
 works more often.  But this should be an optional feature so the user
 who wants to express their intent clearly will not constantly be
 stymied by mpl adjusting the sizes.  Michael Droettboom has worked on
 it and it is a difficult problem to get right.
 
 JDH

I don't mean to bother people with this question again, but has anyone 
implemented this auto-adjust feature that John was talking about? It would be 
nice not having to adjust matplotlib.rcParams['figure.subplot.left'] (and 
friends) in every plot script, or alternatively, through a clever hierarchy of 
matplotlibrc files.

By the way: kudos to matplotlib in every other respect!

Cheers
Paul
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plots do not scale to size

2009-06-10 Thread Paul Anton Letnes

 On 9. juni. 2009, at 17.18, Jouni K. Seppänen wrote:

 Chaitanya Krishna icym...@gmail.com writes:

 On Tue, Jun 9, 2009 at 12:05 PM, Paul Anton Letnes 
 paul.anton.let...@gmail.com 
  wrote:

 When I run the script below, the xlabel and ylabel do not show  
 up. If I
 increase the figure size, it all works fine.

 I am not sure if it is a bug. But, it is usual that such a thing
 happens when you are making small figures (like in your case).

 Arguably it is a bug, since it is reasonable to expect that when  
 you set
 an xlabel or ylabel (or, say, large yticklabels), it shows up in the
 figure. There are at least two problems to solve here: what should  
 the
 user interface be like, and how can it best be implemented?

 The user interface question seems difficult to me. If you set the  
 figure
 size to something small (as in this case) and then add labels, should
 matplotlib reduce the area available for the plot? Or should it  
 reduce
 the font size of the labels and the tick labels, and perhaps the  
 amount
 of white space between the axes and the labels? Or some combination  
 of
 these?

 The implementation question could also be somewhat hairy, since the
 bounding box of text objects depends on the backend. If agg and pdf
 disagree on the size of a label, is it OK to get different-looking
 results in png and pdf?

 -- 
 Jouni K. Seppänen
 http://www.iki.fi/jks


 --
 Crystal Reports - New Free Runtime and 30 Day Trial
 Check out the new simplified licensing option that enables unlimited
 royalty-free distribution of the report engine for externally facing
 server and web deployment.
 http://p.sf.net/sfu/businessobjects
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 This _must_ be a bug. Consider the following:
 ##
 import matplotlib
 matplotlib.rcParams['figure.figsize'] = [8.85, 3.20]
 matplotlib.use('pdf')
 from pylab import *

 xs = linspace(0, 2 * pi)
 ys = sin(xs)
 plot(xs, ys)
 xlabel(r'$T_{est}$')
 ylabel('y axis')

 savefig('test')
 ##
 Here, the vertical size is clearly large enough for a label, as it  
 is a full inch larger than in the previous example. However, the  
 xlabel is truncated. This _must_ be a bug. When I make a plot, I  
 would expect that all parts of the plot appear on the plot.

 As an example, in Gnuplot, the text just appears in the right  
 place, but is too large (overlaps the plot, etc). Hence, you see  
 for yourself that the font size is the problem.

 Anyway, it can't be the font size here, as the xlabel was completely  
 outside the bounding box (I'm not sure of the terminology). To me,  
 it just looks like a problem with the scaling - the plot looks  
 perfectly OK in Illustrator, disregarding that it doesn't fit inside  
 the viewing window.

 I'm not an expert, and I certainly don't know how to fix this. But I  
 do know that other software manages this nicely. Don't get me wrong,  
 I use matplotlib because I like it - but it should be possible to  
 fix this problem.


 Best regards,
 Paul.

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plots do not scale to size

2009-06-10 Thread John Hunter
On Wed, Jun 10, 2009 at 1:58 AM, Paul Anton
Letnespaul.anton.let...@gmail.com wrote:

 This _must_ be a bug. Consider the following:
 ##
 import matplotlib

No it is not a bug -- mpl is doing what you tell it to do.  Consider

   figure()
   subplot(111)
   plot([1,2,3])
   xlabel('hi mom', fontsize=100)

Each command has precise meaning -- the fig creates a figure using the
default size, the subplot occupies a fraction of that figure according
to the default ratios in the subplots_adjust parameters, and the
xlabel makes a label at an indicated physical size.  You may not be
explicitly setting those sizes, but they are all defined via defaults
in the matplotlibrc.  We try and make mpl do what you tell it to do,
not to try and out-smart you and do what we think you are telling it
to do.

Now I definitely support the idea that we should have a *feature* to
auto-adjust the subplots_adjust params and fontsizes so that it just
works more often.  But this should be an optional feature so the user
who wants to express their intent clearly will not constantly be
stymied by mpl adjusting the sizes.  Michael Droettboom has worked on
it and it is a difficult problem to get right.

JDH

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plots do not scale to size

2009-06-10 Thread Paul Anton Letnes
On 10. juni. 2009, at 14.53, John Hunter wrote:

 On Wed, Jun 10, 2009 at 1:58 AM, Paul Anton
 Letnespaul.anton.let...@gmail.com wrote:

 This _must_ be a bug. Consider the following:
 ##
 import matplotlib

 No it is not a bug -- mpl is doing what you tell it to do.  Consider

 figure()
 subplot(111)
 plot([1,2,3])
 xlabel('hi mom', fontsize=100)

 Each command has precise meaning -- the fig creates a figure using the
 default size, the subplot occupies a fraction of that figure according
 to the default ratios in the subplots_adjust parameters, and the
 xlabel makes a label at an indicated physical size.  You may not be
 explicitly setting those sizes, but they are all defined via defaults
 in the matplotlibrc.  We try and make mpl do what you tell it to do,
 not to try and out-smart you and do what we think you are telling it
 to do.

 Now I definitely support the idea that we should have a *feature* to
 auto-adjust the subplots_adjust params and fontsizes so that it just
 works more often.  But this should be an optional feature so the user
 who wants to express their intent clearly will not constantly be
 stymied by mpl adjusting the sizes.  Michael Droettboom has worked on
 it and it is a difficult problem to get right.

 JDH

Hm, I see. Thanks for an informative answer. I'll dig into my rcParams  
and matplotlibrc then...

Best regards,
Paul.


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plots do not scale to size

2009-06-09 Thread Paul Anton Letnes

Dear all.

When I run the script below, the xlabel and ylabel do not show up. If  
I increase the figure size, it all works fine. If I open the file in  
Adobe Illustrator, the x and ylabels are both there, but outside the  
canvas (or bounding box or whatever it is called). I believe this must  
be a bug?


I moved my matplotlibrc file out of its usual location to make sure I  
don't have any funny settings which screws things up. I also deleted  
the tex cache to avoid any tex-related problems.


Best regards,
Paul.
##
import matplotlib
matplotlib.rcParams['figure.figsize'] = [2.85, 2.20]
matplotlib.use('pdf')
from pylab import *

xs = linspace(0, 2 * pi)
ys = sin(xs)
plot(xs, ys)
xlabel(r'$T_{est}$')
ylabel('y axis')

savefig('test')
show()





test.pdf
Description: Adobe PDF document



--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plots do not scale to size

2009-06-09 Thread Paul Anton Letnes

Dear all.


When I run the script below, the xlabel and ylabel do not show up. If  
I increase the figure size, it all works fine. If I open the file in  
Adobe Illustrator, the x and ylabels are both there, but outside the  
canvas (or bounding box or whatever it is called). I believe this must  
be a bug?


I moved my matplotlibrc file out of its usual location to make sure I  
don't have any funny settings which screws things up. I also deleted  
the tex cache to avoid any tex-related problems.



Best regards,
Paul.

import matplotlib
matplotlib.rcParams['figure.figsize'] = [2.85, 2.20]
matplotlib.use('pdf')
from pylab import *

xs = linspace(0, 2 * pi)
ys = sin(xs)
plot(xs, ys)
xlabel(r'$T_{est}$')
ylabel('y axis')

savefig('test')
show()


test.pdf
Description: Adobe PDF document
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plots do not scale to size

2009-06-09 Thread John Hunter
On Tue, Jun 9, 2009 at 10:18 AM, Jouni K. Seppänenj...@iki.fi wrote:
 Chaitanya Krishna icym...@gmail.com writes:

 On Tue, Jun 9, 2009 at 12:05 PM, Paul Anton Letnes 
 paul.anton.let...@gmail.com wrote:

 When I run the script below, the xlabel and ylabel do not show up. If I
 increase the figure size, it all works fine.

 I am not sure if it is a bug. But, it is usual that such a thing
 happens when you are making small figures (like in your case).

 Arguably it is a bug, since it is reasonable to expect that when you set
 an xlabel or ylabel (or, say, large yticklabels), it shows up in the
 figure. There are at least two problems to solve here: what should the
 user interface be like, and how can it best be implemented?

These FAQs are also probably relevant:

http://matplotlib.sourceforge.net/faq/howto_faq.html#move-the-edge-of-an-axes-to-make-room-for-tick-labels
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels

JDH

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users