I am trying to scale the y axis like this:
> a = axes(gca())
This is probably harmless but redundant. gca creates a new axes if
none exists, so you can do
any of the foloowing
a = gca()
a = subplot(111)
a = axes([0.1, 0.1, 0.8, 0.8])
but I wouldn't do axes(gca())
> a.set_ylim((-1.25, 1.25))
> This works fine when yticks is non-empty. However, if I do
> either before or after the set_ylim call, the y axis is not scaled.
> Any suggestions are appreciated.
Make sure that you are updating the figure after you change the
properties. The figure is automatically redrawn after pylab commands
if interactive is True, but afterr calling object setters, you need to
explicitly call draw (if working interactively)
Please post a complete example which exposes the problem, as well as
matplotlib version and backend information. You can get the latter by
running your script with --verbose-helpful.