Skip to content

Unexpected result with log-scaled axes #6

Open
@eltos

Description

@eltos

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions