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 with custom axes" example creates wrong axis when using the pyplot backend #3580

Closed
wg030 opened this issue Jun 21, 2021 · 2 comments · Fixed by #4542
Closed

"Images with custom axes" example creates wrong axis when using the pyplot backend #3580

wg030 opened this issue Jun 21, 2021 · 2 comments · Fixed by #4542

Comments

@wg030
Copy link
Contributor

wg030 commented Jun 21, 2021

I was trying to reproduce the "Images with custom axes" example from the official documentation, when I figured that it creates some strange behaviour using the pyplot backend:
So, just taking the original code yields the same result as give in the documentation. However using the following slightly modified code for use with the pyplot() backend does not create the right axis:

using Plots
using TestImages
pyplot()
img = testimage("lighthouse");
plot([-π, π], [-1, 1], reverse(img, dims = 1), yflip = false, aspect_ratio = :none)
plot!(sin, -π, π, lw = 3, color = :red)

The result will be a plot which has as a x-axis with the intervall [-2π, 2π] and a y-axis with the intervall [-2,2]. It's completley unclear to me why the pyplot backend doubles the values given in the command.

Altough it is extremley easy to quickfix this problem with the command

Plots.plot([-π/2, π/2], [-1/2, 1/2], reverse(img, dims = 1), yflip = false, aspect_ratio = 2)

I don't think that this can be considered a good solution.

@t-bltg
Copy link
Member

t-bltg commented Nov 27, 2022

@t-bltg
Copy link
Member

t-bltg commented Nov 27, 2022

This will be fixed by #4542.

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

Successfully merging a pull request may close this issue.

3 participants