X Tutup
Skip to content

autoscale does not work for axes added by fig.add_axes() #7070

@barpaum

Description

@barpaum
  • Matplotlib version: 2.0.0b4+1.g4e507ae, Python version: 3.5.2 and Platform: Ubuntu 16.04 64bit
  • Matplotlib from source and Python is shipped with system
  • If you run the code either within "ipython3 --pylab" or within a cli, the ax.autoscale() fuction does not work. But strangely, it works inside jupyter or just change "add_axes" to "add_subplot".
import matplotlib as mpl
import matplotlib.pyplot as plt
fig = plt.figure()
xmin=0
xmax=1.6
ymin=0
ymax=1.6
ax = fig.add_axes([xmin,ymin,xmax-xmin,ymax-ymin])
#ax=fig.add_subplot(111)
l=mpl.lines.Line2D([xmin,xmax],[(ymin+ymax)/2,(ymin+ymax)/2])
ax.add_line(l)
ax.autoscale()
print(type(ax))
plt.show()

From "ipython3 -pylab"
screenshot from 2016-09-09 15-41-56

from "jupyter notebook"
index

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup