Skip to content

text axis labels dropped unexpectedly #1495

Description

@jotwin

When I make a plot with text labels on one axis, I expect to see every single label. If we're plotting categorical values we need to know every value. Lets plot is silently dropping them so that labels don't overlap. I've made plots that didn't make any sense because of this missed expectation. I don't think there's a case for dropping these labels, just like we would not want to silently drop categorical labels in a legend because they overlap.

import numpy as np
import polars as pl
from lets_plot import *
LetsPlot.setup_html()

df = pl.DataFrame({
    "x": np.random.randn(100),
    "y": [f"label_{i}" for i in range(100)],
})
(
    ggplot(df, aes(x='x',y='y'))
    + geom_point()
)
Image

For reference seaborn doesn't drop labels and has them overlap.

import seaborn as sns
import matplotlib.pyplot as plt


sns.scatterplot(data=df, x="x", y="y")
plt.show()
Image

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions