50 questions
0
votes
1
answer
186
views
How can I make this plot using Seaborn or matplotlib?
How can I make this plot using Seaborn or matplotlib? A key requirement is that the plot code be less than about 10 lines (this code is meant to go in a book and should not require a PhD in matplotlib)...
0
votes
1
answer
27
views
How to add a title to a faceted bar chart with Seaborn's object interface
I'm using seaborn's object interface and I would like to add a title to it. If I add it via label(title="Super awesome plot"), all facets have the title, but no title over all.
Code:
df = pd....
1
vote
1
answer
140
views
Format y-axis as percentage in a seaborn.objects plot
I found a suggestion to use ticker.PercentFormatter. This changed the decimal numbers on the y-axis to percentages like I want, but the style formatting (grid, background, etc.) is lost, and the ...
1
vote
1
answer
131
views
Seaborn objects stacked bar plot not respecting dodge
I have survey data where I have an 'index' of the survey question, a 'variable' of the answer, and a 'value' of the fraction of respondents that gave the answer. The survey was repeated in two ...
1
vote
1
answer
186
views
Set fontsize of axis and legends in seaborn.objects
I am using seaborn.objects to create a faceted plot. I have read the documentation but setting font size argument does not do anything (Seaborn.objects Documentation)
My Df:
{'storage': {0: '4 °C',
...
0
votes
0
answers
84
views
Seaborn graph in streamlit does not let you customize theme
I would like to modify the theme of a seaborn objects graph displayed through streamlit. However, it seems that the graph only uses the standard theme, disregarding the .theme() part.
The following ...
0
votes
1
answer
57
views
How to have both stacked and dodge bar in same plot in seaborn?
I am trying to have both stacked and dodge in same plot. In below example for each size I would like to have two set of stacked bar plot.
import seaborn.objects as so
tips= sns.load_dataset("...
1
vote
0
answers
58
views
Factor level order in stacked bar plot chart (seaborn.objects +matplotlib)
I have a pandas dataframe. My goal is to create a stacked bar plot chart that is facetted and annotated with the respective percentages.
I am using Python 3.12.3, pandas version '2.2.2', seaborn ...
0
votes
1
answer
400
views
Plotting paired data
I am trying to use seaborn's object-oriented interface to make a plot of paired data where each pair is connected by a line segment. I want a single subplot in the final plot to look like this:
The ...
2
votes
1
answer
867
views
How to add a general title with a seaborn.objects.Plot.facet plot
I am currently using the seaborn library in Python to create a facetted stacked barplot from a pandas dataframe named averages with columns ['Name', 'Period', 'Value', 'Solver'].
Here is the code I ...
1
vote
1
answer
210
views
How to add suptitle to a facet plot created using the seaborn.objects api?
I tried to find a way to add a separate suptitle to a set of subplots created using the seaborn.objects API. However, I couldn't find any such examples in the the docs. Is there a way to do this?
I ...
0
votes
1
answer
148
views
seaborn legend (functions vs. object)
when using seaborn functions I can get all handles and labels:
p=(
sns.scatterplot(data=peng, x='island', y='bill_length_mm', hue='species', style='sex')
)
print(type(p))
h, l = p....
-1
votes
1
answer
189
views
Seaborn objects facet without sharing y axis
I am attempting to create a faceted plot of overlays of three groups within my dataset, however the groups are on different scales so when faceted two of the plots are squashed. Is there a way of ...
2
votes
1
answer
1k
views
How to show all x-tick labels with seaborn.objects
How do I make it so that it shows all x ticks from 0 to 9?
bin diff
1 4 -0.032748
3 9 0.106409
13 7 0.057214
17 3 0.157840
19 0 -0.086567
... ... ...
1941 ...
2
votes
1
answer
258
views
How to order facets when using the Seaborn objects interface
I am trying to order facets in a plot produced by the seaborn objects interface.
import numpy as np
import seaborn as sns
import seaborn.objects as so
import matplotlib.pyplot as plt
df = sns....