Willi> Hi, I am plotting two graphs in one according to
Willi> http://matplotlib.sourceforge.net/examples/two_scales.py
Willi> I want the plot belonging to the right axis to start with
Willi> y=0. However,
Willi> ax2.set_ylim(ymin=0.0)
Willi> does not affect the plot at all.
It always helps to post a complete example; otherwise we have to use
our amazing powers of deduction to figure out what you might be doing
wrong. In this case, two possibilities come to mind:
1) you are calling set_ylim before a plot command and the autoscaler
is kicking on the plot command and overriding your changes. You
should call set_ylim after all plot commands, or turn autoscaling
off with the autoscale_on property of the Axes
2) you are working in interactive mode, eg ipython -pylab, and the
draw command is not being triggered since you are making an OO
call. You can force a draw command in pylab with "draw" or with
fig.canvas.draw().
The following *does* work for me, so maybe you can follow it as an
example
from pylab import *
ax1 = subplot(111)
t = arange(0.01, 10.0, 0.01)
s1 = exp(t)
plot(t, s1, 'b-')
xlabel('time (s)')
ylabel('exp')
# turn off the 2nd axes rectangle with frameon kwarg
ax2 = twinx()
s2 = sin(2*pi*t)
plot(t, s2, 'r.')
ylabel('sin')
ax2.yaxis.tick_right()
ax2.set_ylim(ymin=-3)
show()