Open
Description
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) |
---|---|
![]() |
![]() |
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) |
---|---|
![]() |
![]() |
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?
Metadata
Metadata
Assignees
Labels
No labels