Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images saved as SVG get upside down when svg.image_noscale is True. #1673

Closed
tkanmae opened this issue Jan 17, 2013 · 4 comments
Closed

Images saved as SVG get upside down when svg.image_noscale is True. #1673

tkanmae opened this issue Jan 17, 2013 · 4 comments

Comments

@tkanmae
Copy link
Contributor

tkanmae commented Jan 17, 2013

I created a figure with an image using imshow() and saved it as SVG. I realized that the saved image gets upside down when svg.image_noscale is True.

I'm using matplotlib == 1.2.0 on Mac OS X.

The following code reproduces the issue.

import matplotlib.pyplot as plt
import numpy as np

# Use default configuration.
plt.matplotlib.rcdefaults()

# Create a figure.
fig = plt.figure()
ax = fig.add_subplot(111)
X, Y = np.meshgrid(np.arange(-5, 5, 1), np.arange(-5, 5, 1))
Z = np.sin(Y**2)
ax.imshow(Z, cmap='gray')

# These are ok.
fig.savefig('ok.png')
fig.savefig('ok.svg')

# Set `svg.image_noscale` to True.
plt.rcParams['svg.image_noscale'] = True
# Then, the image is upside down.
fig.savefig('bad.svg')

Thanks,

@dmcdougall
Copy link
Member

Thanks. I can confirm this on current master, too.

@tkanmae
Copy link
Contributor Author

tkanmae commented Jan 17, 2013

I did not have the issue when I was using 1.1.1.

@dmcdougall
Copy link
Member

I have proposed a solution in #1674. Would you be able to try it out and see if it works for you?

@dmcdougall
Copy link
Member

Resolved in #1674.

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

No branches or pull requests

2 participants