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

Unexpected result with log-scaled axes #6

Open
eltos opened this issue Jun 13, 2024 · 0 comments
Open

Unexpected result with log-scaled axes #6

eltos opened this issue Jun 13, 2024 · 0 comments

Comments

@eltos
Copy link

eltos commented Jun 13, 2024

Using views on log-scaled axes results in distorted artists and gives unexpected results compared to plotting the same data twice.

To reproduce, modify the simple example slightly

from matplotview import view
import matplotlib.pyplot as plt

fig, (ax1, ax2) = plt.subplots(1, 2)

# Plot a line in the first axes.
ax1.plot([i for i in range(10)], "-o")

ax1.set(xscale="log", yscale="log")  # <--------- added this line

# Create a view! Turn axes 2 into a view of axes 1.
view(ax2, ax1)
# Modify the second axes data limits so we get a slightly zoomed out view
ax2.set_xlim(-5, 15)
ax2.set_ylim(-5, 15)

fig.show()
Actual result (using view) Expected result (plotting the data twice)
grafik grafik

Passing scale_lines=False to the view improves the situation a bit, but still the markers are distorted:

Actual result (using view with scale_lines=False) Expected result (plotting the data twice)
grafik grafik

Can we have something like scale_artists=False which applies to all artists (markers, text annotations, etc.) and not just lines?
Or even scale=False which applies to everything?

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

No branches or pull requests

1 participant