Skip to content

crash for fig.transFigure.inverted() #513

@volkerkarle

Description

@volkerkarle

Hi folks,
Somehow I am not able to create a subfigure anymore. I have no idea why this was possible before, but now it stopped working.

`fig, ax = plt.subplots()

r = collect(1:10)
ax.plot(r,r .^ 2)

box = ax.get_position()
width = box.width
height = box.height
rect = [1.05,0.1,0.5,0.3]
inax_position = ax.transAxes.transform(rect[1:2])
transFigure = fig.transFigure.inverted()

transFigure = fig.transFigure.inverted() ## Here it crashes
infig_position = transFigure.transform(inax_position)
x = infig_position[1]
y = infig_position[2]
width *= rect[3]
height *= rect[4]
subax = fig.add_axes([x,y,width,height])
subax.plot(r, r.^3)

plt.tight_layout()
plt.show()`

Everything at newest version.

best,

v.

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