Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
86 views

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 ...
timelessbeing's user avatar
1 vote
1 answer
103 views

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 ...
Erin W's user avatar
  • 59
0 votes
0 answers
49 views

I'm trying to pass a list of variables to the so.Dodge function of seaborn objects, so that in my plot provided in the following example, the dodge is applied only on two of three possible variables. ...
marpuech's user avatar
0 votes
0 answers
13 views

How to change the color of kde line in a histplot of seaborn? I'm using this code to plot the histogram: p = sns.histplot(data=diamantes, x='carat', bins=40, color='#90d8fc', kde=True) In the ...
Jefferson La Rosa's user avatar
0 votes
0 answers
11 views

In the seaborn.objects interface, there is a limit method that allows you to set the x and y axis limits. But I need to be able to get those axis limits and/or get the highest count for the a ...
Todd Shannon's user avatar
1 vote
1 answer
158 views

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', ...
mr.raccoon's user avatar
0 votes
0 answers
69 views

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 ...
divingTobi's user avatar
  • 2,350
0 votes
1 answer
43 views

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("...
itthrill's user avatar
  • 1,396
1 vote
0 answers
54 views

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 ...
mr.raccoon's user avatar
0 votes
1 answer
331 views

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 ...
gbarl's user avatar
  • 1
2 votes
1 answer
815 views

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 ...
Haeden's user avatar
  • 329
1 vote
1 answer
203 views

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 ...
Axel Truedson's user avatar
0 votes
1 answer
143 views

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....
MK grafics's user avatar
-1 votes
1 answer
145 views

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 ...
jstathakis's user avatar
2 votes
1 answer
1k views

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 ...
guckmalmensch's user avatar
2 votes
1 answer
241 views

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....
Joshua Shew's user avatar
  • 1,061
2 votes
1 answer
179 views

The default log scale in seaborn.objects doesn't show the minor log grid lines. How can they be turned on? #Synthetic data import pandas as pd from scipy.stats import expon data = pd.DataFrame({'rate':...
MuhammedYunus's user avatar
1 vote
0 answers
653 views

Formatting of the so.Text() mapping doesn't seem to have an effect on text labels. In the example below, I am trying to format using the text= scale such that the text labels are rounded to 1dp and ...
MuhammedYunus's user avatar
5 votes
1 answer
796 views

I have a recurring problem with legends on many of my plots with legends. The legend often obscures part of the data. Reproducible example: import seaborn.objects as so import numpy as np import ...
MuhammedYunus's user avatar
2 votes
1 answer
372 views

I am trying to learn the seaborn object Plot() interface. With the traditional sns.barplot() we could easily define color palette for the bars. import seaborn as sns df = sns.load_dataset('penguins') ...
Satyaranjan Sahoo's user avatar
2 votes
1 answer
875 views

I'm using the seaborn.objects interface to label plot points. However, I can't add a trendline if the labels are present. Adding the argument text='label' and the method .add(so.Line(color='orange'), ...
doine's user avatar
  • 344
0 votes
0 answers
146 views

Hi I am trying to give title to this plot. Instead of having a common label, the labels are shared among the plots. Is there any way to not switching from seaborn object. ( so.Plot(df,x="...
Pritom Roy's user avatar
3 votes
1 answer
187 views

I am trying to use seaborn object interface. It looks intuitive like ggplot2 in R. However, since it is still in development stage, the underlying documentation is still WIP. For example I am trying ...
itthrill's user avatar
  • 1,396
2 votes
1 answer
366 views

Typically if I want to make an interactive plot, I use %matplotlib qt, such that I can explore, zoom, add to the figure etc. I wanted to make an area plot, and with the release of seaborn objects, ...
iadriaens's user avatar
0 votes
0 answers
323 views

I am a native R user but need to use Python in a new job. Seaborn objects seems to match up with ggplot much more closely (I know about plotnine; let's ignore it for now). Unfortunately, it is not ...
jpm_phd's user avatar
  • 935
1 vote
1 answer
1k views

Using seaborn python library, I am trying to make several density plots overlapping each other in the same figure and I want to color/label each of the lines. Using seaborn objects interface I am able ...
rkmalaiya's user avatar
  • 508
0 votes
0 answers
284 views

I would like to create a tornado plot using seaborn objects and was wondering if there was an efficient way to do this. import numpy as np import pandas as pd import seaborn.objects as so # create a ...
divingTobi's user avatar
  • 2,350
2 votes
1 answer
3k views

How can I add space between Male and Female bars in seaborn histplot ? import seaborn as sns tips = sns.load_dataset("tips") sns.histplot(data=tips, x="day", hue="sex", ...
python_programmer's user avatar
9 votes
2 answers
527 views

I am creating a figure (with the seaborn.objects interface) that requires a legend with both colors and markers. I am trying to move the legend that is generated, but I am having trouble moving the ...
user21559775's user avatar
2 votes
1 answer
654 views

I am running the code in jupyter, which displays a plot figure. However, without plt.show(), the same plot is duplicated, so two plot figures are display. Why is this happening? import matplotlib....
user21559775's user avatar
4 votes
2 answers
219 views

I am new to this, trying to plot 2 subfigures horizontal with sample data using Matplotlib and Seaborn library in Jupyter Notebook, the 2 sub-charts come out alright, but the 2 legends overlap each ...
user21559775's user avatar
2 votes
1 answer
915 views

How can I use the objects API to plot a regression line with confidence limits (like sns.regplot / sns.lmplot)? Based on the so.Band fmri example, I thought it would be something like this: import ...
tdy's user avatar
  • 42k
2 votes
1 answer
945 views

I want to color my dots in a scatterplot with some rgb values. Using the original api, this is easy: import seaborn as sns x = [0, 1, 2] y = [0, 0, 0] colors = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] sns....
Sandro Martens's user avatar
3 votes
1 answer
577 views

I am trying to prepare a bar plot using seaborn.objects with time series data where the x-axis ticks and labels are only on the dates that really appear in the data. import pandas as pd import seaborn....
divingTobi's user avatar
  • 2,350
0 votes
2 answers
422 views

In the original API, barplot provided an orient parameter to swap bar orientation: import pandas as pd, numpy as np, seaborn as sns df = pd.DataFrame(data=np.random.randint(10, size=(3, 5)), columns=[...
tdy's user avatar
  • 42k
1 vote
2 answers
921 views

Is there a way using seaborn objects to add arbitrary line into a plot? Something like ggplots geom_abline specifying slope and intercept? I mean, using seaborn objects API only. ... # this DOES NOT ...
dmat's user avatar
  • 21
0 votes
1 answer
190 views

Is there a way to both bin and aggregate (with some other function than count) in seaborn.objects? I'd like to compute the mean per bin and right now I'm using the following: import seaborn.objects as ...
nicolaskruchten's user avatar
2 votes
1 answer
914 views

I'm trying to make a plot with bars or areas rescaled to 100% with the new seaborn.objects interface and I can't seem to get so.Norm() to work, with or without by... Here's what I've got so far: ...
nicolaskruchten's user avatar
4 votes
1 answer
478 views

I am trying to add text labels to the top of a grouped/dodged bar plot using seaborn.objects. Here is a basic dodged bar plot: import seaborn.objects as so import pandas as pd dat = pd.DataFrame({'...
NickCHK's user avatar
  • 1,253
1 vote
1 answer
201 views

I'm trying to create bar plot with labels on bars. Position of labels and color of labels depends on column of dataframe. Also, I would like to color bars by column. My data: data = { 'Survived': [...
Jan Čáp's user avatar
1 vote
1 answer
245 views

I am creating a plot in seaborn.objects. This plot has a legend, and I would also like to change its size. This can be done using the .theme() method, which affects the matplotlib rcParams: import ...
NickCHK's user avatar
  • 1,253
0 votes
1 answer
783 views

I am working with the excellent seaborn.objects module in the most recent version of seaborn. I would like to produce a plot: With rotated x-axis labels With facets Rotating x-axis labels is not ...
NickCHK's user avatar
  • 1,253
1 vote
1 answer
1k views

I would like to create a line + ribbon plot similar to these ones created with ggplot2 using geom_line + geom_ribbon: For that, I would like to use the new seaborn.objects interface, but even though ...
user avatar
5 votes
2 answers
3k views

By chance, is there a way to rotate the xticks in the graphic below (just to make it a bit more readable)? The usual sns.xticks() doesn't work in the new seaborn.objects development (which is amazing!)...
Robert Chestnutt's user avatar
1 vote
1 answer
641 views

How to disable the axes' ticklabels for seaborn.objects generated image? import seaborn as sns from seaborn import objects as so tips = sns.load_dataset("tips") ( so.Plot(tips, "...
J.W's user avatar
  • 719
4 votes
1 answer
1k views

The solutions shown in How to change the figure size of a seaborn axes or figure level plot do not work for seaborn.objects. This question is about the new interface added in seaborn v0.12. Tried ...
J.W's user avatar
  • 719
8 votes
0 answers
1k views

I am using the new seaborn.objects API available in v0.12.0. None of the examples show how to move the legend position. For example, moving the legend to the bottom. Is there a way to do this? Using ...
Abiel's user avatar
  • 5,525
0 votes
1 answer
132 views

I just started digging into the new seaborn.objects interface, which I liked pretty much. Though seaborn.pairplot works fine for me, I have stumbled upon trying to make a nice lower-triangle pairplot ...
Nikita Shabankin's user avatar
2 votes
1 answer
2k views

I am using seaborn objects to plot a stacked bar chart and I am wondering what the right was is to change the sort order in which the bars are stacked. Looking at this example: import seaborn.objects ...
divingTobi's user avatar
  • 2,350
8 votes
2 answers
4k views

The new Seaborn objects (v 0.12) are great but I struggle to deal with legend customization. Especially when using matplotlib to define subplots. My code: f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, ...
GTMeijer's user avatar