Skip to content

Inconsistent inset_axes position between show(), savefig(format='png') and savefig(format='pdf') #8120

Description

@sorenrasmussen

Bug report

Bug summary

inset_axes inconsistently positioned between show(), savefig(...,format='png') and savefig(...format='pdf') when the dpi option is set.

Code for reproduction

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes

fig = plt.figure(dpi=150);

ax1 = plt.gca()
ax1ins1 = inset_axes(ax1, width=.7, height=.7,bbox_to_anchor=(100,100))

plt.savefig("test.pdf",format='pdf',dpi=300,bbox_inches="tight")
plt.savefig("test.png",format='png',dpi=300,bbox_inches="tight")
plt.show()

Actual outcome

PDF:
test_pdf
PNG:
test
show():
show

Expected outcome

I would expect all the results to come out the same.

Matplotlib version

  • Matplotlib 2.0.0 (conda)
  • Python 2.7.13 (conda)
  • Platform: Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions