Questions tagged [seaborn]

Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Add the seaborn-0.12.x tag for questions about seaborn.objects.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
49 views

Lollipop plot for dataframe with two groups

I have the following dataframe: Country variable value 0 Afghanistan Area 38.232510 1 Afghanistan Yield 70.081666 2 ...
user308827's user avatar
  • 20.9k
0 votes
0 answers
30 views

Heatmap with sklearn Confusion Matrix issue [duplicate]

I bumped into the following issue: X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.25, random_state=42) y_pred = model.predict(X_test) y_pred = (y_pred > 0.5) ...
ArtemNovikov's user avatar
0 votes
0 answers
22 views

Heatmap showing only one line of annotations [duplicate]

I am trying to create a Seaborn heatmap with annotations. The heatmap colors displays properly, but annotations are not complete. I am getting a consistently truncated display to only the first line. ...
Gabe's user avatar
  • 1
0 votes
0 answers
35 views

seaborn 0.13.0 pointplot native_scale TypeError: pointplot() got an unexpected keyword argument 'native_scale'

According to the documentation seaborn pointplot says: By default, this function treats one of the variables as categorical and draws data at ordinal positions (0, 1, … n) on the relevant axis. As of ...
travelingbones's user avatar
-1 votes
0 answers
51 views

I am trying to visualize some data [closed]

I have 11 columns and one target column against which I want to visualize 11 column's data but I am getting some very weird plots which I can not use Result of my code I have used this code data1=['...
Prakhar Srivastava's user avatar
-3 votes
1 answer
60 views

How to make one column of bold annotations on a heatmap

How to format (make bold) the annotations in one particular column in a Python Seaborn heatmap? (https://seaborn.pydata.org/generated/seaborn.heatmap.html)
Marc8932's user avatar
  • 109
0 votes
0 answers
26 views

How to draw a box plot with white face color on top of a violin plot and swarm plot [duplicate]

I want to draw the following box-plot with white face color overlaid on a violin plot and swarmplot, something similar to the following plot: This is the following code that I was trying: ax = sns....
Aditya Bhattacharya's user avatar
0 votes
1 answer
30 views

Plotting a secondary Y axis and adding a joint legend [duplicate]

I would like to plot a secondary Y axis and add a joint legend for my line plot, area plot, and the two horizontal lines. How can I modify the code to make this work? watts = rolig_tur_kaldt["...
Simen Løkken's user avatar
0 votes
1 answer
42 views

Is there a way to use the same pallette for 2 scatter subplots, even if the content of the dataset is not the same [duplicate]

i have an annoying problem that is i believe best demonstrated when looking at the picture below ( take a look at the legend and the missing "1". inconsistent colors x1 and x2 are the axis ...
Konstantin Frunzek's user avatar
1 vote
1 answer
42 views

stacked area chart without density on y-axis

I am wanting to create what looks like a stacked area chart - however, the y-axis of the chart must not be a proportion (between 0 and 1) but rather a count of the number of observations per group per ...
JoMcGee's user avatar
  • 67
1 vote
1 answer
49 views

Formatting datetime64 dates as xticks [duplicate]

In a DataFrame I have column "Datum2" with datetime64 formatted dates (YYYYMMDD) that I want to use as xtick labels. My current plot looks liket this: I want to change the labels to show ...
Yeb0's user avatar
  • 21
-3 votes
0 answers
48 views

Plotting a continuous 40 year Histogram data [duplicate]

I am trying to plot daily recorded data over forty years(14k+ data size). For some reasons, my histogram is faulty and all over the place(irregular and some datapoints not starting from base). I am ...
Sarthak Rawat's user avatar
0 votes
1 answer
43 views

Problem with order of elements when combining violin and point plot in seaborn [duplicate]

I am trying to make a combined plot using seaborn - violin plot with sticks inside and the mean+std pointplot on top of it. I have three categories that I want to use for hue. Somehow, the leftmost ...
Willow Sprig's user avatar
-1 votes
1 answer
60 views

numpy.ndarray object is not callable when trying to change x-Ticks [closed]

I am currently working on a university project where I want to plot sentiment scores over a period of time. I've attached a picture of said scatterplot. I now want to change the xticks, the xtick ...
Yeb0's user avatar
  • 21
1 vote
1 answer
41 views

Set lineplot marker for only one line

I am trying to plot a seaborn lineplot with 2 lines: one with markers and one without. In the documentation (https://seaborn.pydata.org/generated/seaborn.lineplot.html), it says that, in order to ...
Daniel's user avatar
  • 651
-1 votes
0 answers
33 views

How to plot a boxplot with 25% 50% 75% quantile line and the scatters only?

I am going to plot a boxplot with 25% 50% 75% quantile line and the scatters only (without the boox) in python, here is a toy example: . I tried plt.boxplot(data, showbox=False) but the result is ...
Knotnet's user avatar
  • 19
-1 votes
0 answers
50 views

How do I create a lexical dispersion plot?

I'm trying to make a lexical dispersion plot that maps out when words in a certain 'top ten' list are used over time through a column of strings in a Pysparks data frame (another column has their ...
Ruth's user avatar
  • 1
0 votes
0 answers
25 views

Xtick Label Shift Problem with 2 Plots Overlaid [duplicate]

I am trying to make a combined plot using seaborn boxplot and scatterplot. The problem is that my xtick labels are not aligned and I've tried many solutions. the red data values are the values that ...
user2100039's user avatar
  • 1,306
-1 votes
1 answer
80 views

How to pass histogram bins for each discrete value in 2D histogram and plot it

My data can be seen as a time series. For t=0 there is some data x0, then for t=1 some data x1, etc. I am trying to create a 2D histogram using sns.histplot here for reference of this data. I want to ...
Schach21's user avatar
  • 400
0 votes
1 answer
95 views

Seabron heatmap only annotating the first row [duplicate]

I have: Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] matplotlib 3.8.0 seaborn 0.12.2 import numpy as np import seaborn as sns sns.heatmap(np.random.rand(3, 3), annot=True) The output on ...
Anonymous Entity's user avatar
0 votes
0 answers
22 views

Seaborn heatmap won't generate an image with annotated cells [duplicate]

I have this heatmap drawn by seaborn: # Draw Heat Map def draw_heat_map(): # Clean the data # 0. Copy original df to new dataframe df_heat = df.copy() # Create boolean mask to select ...
ArceusLegend50's user avatar
0 votes
1 answer
37 views

How does the Seaborn timeseries plot with error bands example get its error band data from?

This question relates to this example from the Seaborn documentation. I do not understand how the plotting library is obtaining error information. The function called, with arguments is as follows. ...
FreelanceConsultant's user avatar
0 votes
1 answer
25 views

Seaborn not generating the correct figure [duplicate]

I have the following code to generate a catplot: import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np # Import data df = pd.read_csv('numpy_pandas\data\...
ArceusLegend50's user avatar
-1 votes
0 answers
24 views

matplotlib tick label is mix of plain and scientific notation [duplicate]

From the following code, the first ticks on the x axis becomes scientific notation as I am showing in the screen shot. fig, ax = plt.subplots() for name in self.config_name: x, y = self....
A.E's user avatar
  • 989
2 votes
1 answer
34 views

Setting xtick formatter on seaborn catplot changes the value of the x ticks to the index

I'm trying to visualize a simple order book dataframe with a seaborn catplot. However, when I set the format of the x tick labels of the ax of the catplot, it changes the values of the labels to being ...
user75811's user avatar
  • 163
6 votes
2 answers
732 views

Only the first row of annotations displayed on seaborn heatmap

As it's usually advised, I have managed to reduce my problem to a minimal reproducible example: import numpy as np import seaborn as sns import matplotlib.pyplot as plt matrix = np.array([[0.1234, 1....
Mantas Kandratavičius's user avatar
-1 votes
0 answers
35 views

why am i getting ValueError: could not convert string to float: 'Iris-setosa' while plotting heatmap

I am using the iris dataset for visualization and the error occurs in this line sns.heatmap(data=data.corr(), annot=True,cmap = "GnBu") I tried manually converting the "Iris-setosa&...
APURV NIKUM's user avatar
-1 votes
0 answers
10 views

How to create subplots with scatter plot having hue and regression line in seaborn?

I'd like to plot three scatterplots into subplots (1 row, 3 columns) I have 4 categories in my dataset and would like to split the data per these categories based on colours. I also would like to plot ...
Ablenya Barros's user avatar
-1 votes
0 answers
24 views

Seaborn: how to take mean of fitted lines instead of fitting means of points?

I am using seaborn's lineplot to plot many lines from a pandas.DataFrame. These lines represent stochastical realisations of some process, where each run is identified by a column run. When I use ...
lm1909's user avatar
  • 33
0 votes
0 answers
47 views

Extracting data points within the hexbins and the contour line

I use the following code to create hexbins and a kde contour line. It colours each hexbin with the average 'Score' values of data points. import pandas as pd import seaborn as sns import matplotlib....
SuleymanSelim's user avatar
1 vote
1 answer
24 views

How to extract xvalues and yvalues from a kdeplot

Given that I have a seaborn.kdeplot I want to extract the x and y points. Based on similar questions I have tried the following: points = sns.kdeplot(targets, shade=True, label='train').get_lines()[0]....
James Arten's user avatar
2 votes
1 answer
69 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 ...
guckmalmensch's user avatar
-1 votes
2 answers
92 views

packages not found after installation on Windows

I switched from a Mac to Windows 11 and have issues with my python scripts or with the packages more precisely. I installed seaborn with pip install seaborn via PowerShell but when I run import ...
user20501139's user avatar
-1 votes
1 answer
41 views

Iterating through all combinations of categorical variables in stripplot

import matplotlib.pyplot as plt import seaborn as sns for i in data: for j in data: for k in data: sns.stripplot(data=data1, x=i, y=j, hue=k) plt.show() I am trying to ...
Jay's user avatar
  • 13
0 votes
0 answers
50 views

Creating automatized Presentation and Formatting POWERPOINT slides in 1920 x 1080 NO DUPLICATE [duplicate]

I use yfinance to download financial data from yahoo finance. For this I have written a code that can be used to get the data. I then use the data to plot distribution charts with Searborn and then ...
Economist Learning Python's user avatar
0 votes
1 answer
57 views

How to customize the color scatterplot legend handle [duplicate]

I have a seaborn scatterplot with datapoints distinguished by (1) color and (2) marker. This is the minimal code that generates the plot: d = {'x': [1, 2, 3, 4], 'y': [2,4,6,8], 'Set': ["Set 1&...
innakigc's user avatar
1 vote
2 answers
48 views

How to set heatmap to grayscale and annotate with a mask

I have a matrix A: A = np.array([[ 0. , 0.00066748, -0.00097412, -0.00748846, 0.00305338], [-0.00157652, 0. , 0.0048117 , 0.01069083, -0.0137888 ], [-0.00713212, -0....
user9875321__'s user avatar
1 vote
2 answers
53 views

How to convert y-axis tick label numbers to letters

For the code: import numpy as np import matplotlib.pyplot as plt import seaborn as sns data = list(map(lambda n:str(n), np.random.choice(np.arange(1,50), 1000))) fig, ax = plt.subplots(1,1) sns....
Jihyun's user avatar
  • 903
1 vote
1 answer
43 views

How to add grey area behind boxplots without affecting boxplot colors [duplicate]

I am doing a boxplot, where I would like to add a grey zone behind my boxplots. However, when I do that, the boxplots are getting grey instead of black (see image below). What can I do to keep the ...
carolinehg's user avatar
0 votes
0 answers
17 views

searborn plot write legend on x-axis [duplicate]

I want to plot a barplot using seaborn where I have given x, y and hue. My problem is that hue is shown as legend. I want to show the hue on the a-axis itself. Is there any means to do so? Using the ...
Rupal Shah's user avatar
-2 votes
0 answers
21 views

jointplot in PowerBI comes out different vs IDE

I'm experimenting with creating jointplots in Python in PowerBI. This is the code: sns.jointplot(data=dataset, x='average_montly_hours', y='satisfaction_level', kind='kde') First picture is the graph ...
Solana Liu's user avatar
-1 votes
0 answers
13 views

Using name for months instead of numbers when creating boxplot [duplicate]

What I have Data frame containing data about companies. In particular: Column 'Month Joined' as int64 Column 'Years To Join' as int64 List month_order: ['January', 'February', 'March', 'April', '...
Gevorg's user avatar
  • 1
-1 votes
0 answers
21 views

How to move Seaborn boxplot relative to plotted sample data (stripplot) so they are placed side-by-side? [duplicate]

In this example showing boxplots plotted together with the sample data, the dots and boxes are positioned to overlay each other: https://seaborn.pydata.org/examples/horizontal_boxplot.html import ...
Dan's user avatar
  • 1,277
-2 votes
0 answers
27 views

How to plot bar graph from values separated with commas [duplicate]

The DATA contains two columns one with the name of hotels and the other with number of dishes separated by commas that are liked by customers. I want to find the count of dishes which are separated by ...
r anderson's user avatar
-1 votes
0 answers
42 views

Getting Values on each of the individual subsections [duplicate]

Just a little background info. I am working with this data which I got from a group-by function of: Month Region Count April Bronx 15 April Brooklyn 14 April Manhattan 8 April Nassau County 2 ...
JJ.301.'s user avatar
  • 11
0 votes
2 answers
39 views

x axis tick labels are one position ahead of data points [duplicate]

I have a seaborn lineplot that shows two categories' quarterly count changes. The issue is that the x-axis labels are one position ahead of the data points. I adjusted my code, but it didn't help. ...
Osca's user avatar
  • 1,600
-1 votes
1 answer
88 views

How can I resolve "UserWarning: The palette list has more values (10) than needed (4), which may not be intended"?

I am using "tab10" palette because of its distinct colors blue, green, orange and red. k_clust = KMeans(n_clusters=4, random_state= 35, n_init=1).fit(df_normal) palette = sns.color_palette(&...
andy_H's user avatar
  • 13
-1 votes
0 answers
27 views

TypeError: unsupported operand type(s) for *: 'Timestamp' and 'float' [duplicate]

I am trying to plot a regplot graph between date and stock price. The date is in timestamp datatype and price is float datatype. How do I plot replot between these two? .I am trying to plot a regplot ...
Mainak97's user avatar
-1 votes
1 answer
33 views

Removing legends per facet and create one general legend + adding x-axis labels to facets [duplicate]

So, I'm currently trying to construct a plot in python 3.9, using Pandas, Seaborn and Matplotlib. While I'm not able to share the data itself, I can explain a bit about it. I have 6 different ...
Fred's user avatar
  • 16
-2 votes
1 answer
32 views

ValueError in Seaborn

I'm breaking my head here because of the following error. I checked this line of code several times: import seaborn as sb sb.scatterplot(x="celsius", y="fahrenheit", datos=...
Lucas Alexandre's user avatar

1
2 3 4 5
190