Closed Xparx closed 1 year ago
I don’t understand.
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)
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
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
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.
See #3069
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?
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