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

defaults to grid(False) for dotplots using seaborn objects so.Dot #3162

Closed
Xparx opened this issue Nov 27, 2022 · 4 comments
Closed

defaults to grid(False) for dotplots using seaborn objects so.Dot #3162

Xparx opened this issue Nov 27, 2022 · 4 comments

Comments

@Xparx
Copy link

Xparx commented Nov 27, 2022

Trying to plot with the seaborn objects.
Using so.Dot()
the following line when commented out reintroduce the grid options.
https://github.com/mwaskom/seaborn/blob/master/seaborn/_core/plot.py#L1659

@Xparx Xparx changed the title defaults to grid(False) for dotplots defaults to grid(False) for dotplots using seaborn objects so.Dot Nov 27, 2022
@mwaskom
Copy link
Owner

mwaskom commented Nov 27, 2022

I don’t understand.

@Xparx
Copy link
Author

Xparx commented Nov 29, 2022

Sorry for being unclear. I'm trying to use the new seaborn interface for plotting.

I'm trying to make a Dot plot with grid lines

sns.__version__
'0.12.1'

the problem is i can't get the grid lines to show up even using

if I just use the following code snippet

fig = plt.figure(figsize=figsize, constrained_layout=True, dpi=dpi)
ax = fig.add_subplot(111)
ax.grid(linestyle='--', lw=0.2)
ax.set_axisbelow(True)

p = (
    so.Plot(
        tmp,
        y="y",
        x="x",
        color="p_value", 
        pointsize="Ratio",
    ).add(so.Dot(edgecolor='k')).on(ax).label(x='bla1', y='bla2')
    .scale(color="flare", pointsize=(1, 20))
    .theme({"axes.facecolor": "w", "axes.grid": True, 'axes.axisbelow': True})
)
p

I get an output (using jupyter-notebook)
image

I don't get any grid lines, if i comment out the line in plot.py
# axis_obj.grid(False, which="both")
and use the same code I get
image

I have tried a few different combinations of grid commands, but without commenting out the the line I get no grid lines.
However if I use

fig = plt.figure(figsize=figsize, constrained_layout=True, dpi=dpi)
ax = fig.add_subplot(111)
ax.grid(linestyle='--', lw=0.2)

p = (
    so.Plot().on(ax)
    .theme({"axes.facecolor": "w", "axes.grid": True, 'axes.axisbelow': True})
)
p

image

I get grid lines even without commenting out the line. Adding data removes the grid lines.
(please note I tried to make the code more readable so figure legend is missmatching).
I do need to use an external ax.grid command either way.

@mwaskom
Copy link
Owner

mwaskom commented Nov 30, 2022

See #3069

@mwaskom mwaskom closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2022
@Xparx
Copy link
Author

Xparx commented Mar 27, 2023

I don't see how the link helps me figure out how to get grid lines.
Where should I look for that. Or are you suggesting that they are not available at all?

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

2 participants