question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sharex, sharey, factorplot

See original GitHub issue

I found a very small bug when using factorplot.

sharex, sharey don’t get propagated to FacetGrid, line 835 in linearmodels.py.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mpschrcommented, Sep 1, 2015

Hi @mwaskom ,

Let me say first, that I have not taken a good look at the code, so I don’t know how the interior works. In any case, when one specifies a factor as x-axis, then I guess it can be expected that sharex is directly related to the x parameter - even tough it being a factor. I don’t know if I explained well enough, but I expected the same would happen, as if x were numeric: the axis range is adapted to the data represented in the subplot.

I don’t know if you agree and think it might be implemented? If not, I’d introduce a warning message saying something the like sharex=False cannot be applied to a factor-axis.

I’ll go have a try with FacetGrid, thanks for the suggestion.

Michael

0reactions
christian-oreillycommented, Apr 13, 2018

Same issue here. Using

g = sns.factorplot(x="bins", y="density", hue="species2", col="small_mtype", 
                   data=data, 
                   sharex=False, sharey=False,
                   rows="small_mtype",
                   size=5, linewidth=1)

I can obtain a nice plot for data which are histogram-like (i.e., normalized count-per-bin; 30 bins with range [0, 200]):

image

However, the range for the left plot should definitely be larger. So I would like to have 30 bins with a range [0, 400] for the left plot and [0, 200] for the right plot. Plotting such a dataset now does not give a nice result:

image

This is because the x-factor is shared between the other grouping factors (e.g., grid column and row factors). I wonder if it would be possible to add a switch that would allow to disable explicitly this sharing of the x/y factors across column/rows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - seaborn.factorplot() method - GeeksforGeeks
share {x, y} : (optional) This parameter take bool, 'col', or 'row', If true, the facets will share y axes across columns and/or...
Read more >
How to use the seaborn.factorplot function in seaborn - Snyk
To help you get started, we've selected a few seaborn.factorplot examples, ... sharex=True, sharey=False) else: ax = sns.factorplot(data=df, x='genome', ...
Read more >
How to use sharex and sharey combined with aspect=equal ...
I would like to get something like the plot in the image below, that shows the axes shared as I mentioned above, keeping...
Read more >
seaborn.catplot — seaborn 0.12.1 documentation - PyData |
Figure-level interface for drawing categorical plots onto a FacetGrid. This function provides access to several axes-level functions that show the relationship ...
Read more >
Seaborn Multiple Plots: Subplotting with matplotlib and seaborn
sharex and sharey are used to share one or both axes between the charts (needed data to work). fig, axes = plt.subplots(1 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found