Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improper ylabel_top placement #48

Open
markmbaum opened this issue Oct 21, 2022 · 0 comments
Open

Improper ylabel_top placement #48

markmbaum opened this issue Oct 21, 2022 · 0 comments

Comments

@markmbaum
Copy link

markmbaum commented Oct 21, 2022

I've been using matplotx.ylabel_top and just noticed an issue with the label placement after setting the y tick labels explicitly. A working example is below.

import numpy as np
from seaborn import scatterplot
import matplotx

rng = np.random.default_rng(42)
x = rng.random(100)
y = -2*x + rng.normal(0, 0.5, 100)
ax = scatterplot(
    x=x,
    y=y
)
ax.set_yticks([0, -1, -2])
matplotx.ylabel_top('Example\nLabel')

example

i'm using

numpy==1.23.4
seaborn==0.12.1
matplotx==0.3.10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant