On Thu, Jun 7, 2012 at 3:44 PM, Mark Gurling <magurl...@gmail.com> wrote:

> I am on Ubuntu 11.10
> matplotlib version 1.1.0
> numpy version 1.5.1
>
> I have two bar graph scripts (good.py and bad.py). Each generates a graph
> that contains two bars: one bar that extends along the positive y-axis and
> another bar that extends along the negative y-axis. The only difference
> between the two scripts is that in good.py the positive bar extends to
> 69.0, but in bad.py it extends to 70.0; however, while in good.py the
> y-axis ends precisely at -30.0, in bad.py the y-axis ends below -30.0
> despite the yticks setting specified on line 20. Is there an explanation
> for this behavior? How might I remedy this?
>
>
`yticks()` just sets the ticks, which shows up correctly in both plots. It
sounds like what you want to specify is the axis limit. You can add the
following (e.g. after the call to `yticks`):

   plt.ylim(ymin=-30)

As for the reason, it has to do with creating axes sizes that fit all the
elements within the plot area and also allow ticks that are "nicely"
spaced. You just happen to be near the threshold of two different spacings,
I think.

-Tony
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to