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
-3 votes
0 answers
20 views

Is there a way to fix the structure of Regplot and make it nicer to look?

regplot I tried to regplot the x variables and y variable as actual productivity of garments, but the regplot i've made is ugly because most of index are 0. How can i fix the regplot? I want it to be ...
Roses me's user avatar
0 votes
0 answers
17 views

Maintain the font of the whole plot (x and y axis), but keeping the labels on top of the graph smaller so they dont overlap

Basically I am using different columns to plot my data using seaborn. I use sns.set_context("talk") so the font is big enough to be read properly. However, since the specifications of the ...
Javier Rodriguez 's user avatar
1 vote
0 answers
37 views

seaborn heatmap cell style for nan-Values

I have created a heatmap with seaborn in a jupyter notebook: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set(rc={"figure.figsize": (10, 10), }) sns.set(...
i.i.k.'s user avatar
  • 155
1 vote
1 answer
27 views

Matplotlib axes formatter is not working correctly in Seaborn Stripplot

For some reason, when I try to use a matplotlib.ticker.FuncFormatter to reformat the x axis of a seaborn stripplot, it reformats the positions instead of the labels, MWE below. Using the same ...
Jazz Weisman's user avatar
0 votes
1 answer
26 views

Changing the data for hue in a scatterplot created by Seaborn relplot does not update the legend

I have five columns in a pandas dataframe df: 'axis_1', 'axis_2', 'axis_3', 'axis_4', and 'axis_5'. I create a scatter plot using Seaborn's relplot function as follows: grid = sns.relplot(data=df[[...
Dario de Judicibus's user avatar
2 votes
2 answers
47 views

Pandas: Combine category-based heat map with values-based heatmap?

I'm trying to have a heatmap where each of the 5 categories (x axis) has its own overall color and the value for each month determines how light or dark that square is. I've been using sns.heatmap for ...
Matthew JJJ's user avatar
0 votes
0 answers
25 views

Add one more value to Seaborn stripplot?

I'm using the code below to bring back a plot where day and hour and product (hue) are indicated, but the quantity ("day_count") in each hour-day-product aren't. I would have thought I could ...
Matthew JJJ's user avatar
0 votes
0 answers
7 views

I have this code for my heatmap: plt.figure(figsize=(12,9), facecolor=#ECEFF4) sns.heatmap(customers.corr(), cmap=RdBu); How do I remove duplicates?

I have generated a Seaborn SNS heatmap which shows the full map, including duplicated info, redundant dat, etc. How do I refine it to remove this unwanted details? plt.figure(figsize=(12,9), ...
Salim Yakub's user avatar
0 votes
0 answers
16 views

How do i solve the urlopen error in sns.load_dataset('tips')?

I am trying to load the 'tips' dataset in my jupyter notebook but it's showing an error. However, sns.get_dataset_names() is working. I have attached the screenshot for reference. I am using the M1 ...
Vishal Prasad's user avatar
0 votes
0 answers
19 views

PerfectSeparationError while Plotting regression plot solved. How? [duplicate]

I am working on logistic regression of data. Data contains two columns: Age, Insurance_bought (Value 0: Not Bought, Otherwise, Value is 1) I used given code to plot regression plot. import seaborn as ...
Mathematics Maniac's user avatar
0 votes
3 answers
101 views
+50

Create waterfall chart

I have a problem. I want to create a waterfall chart. But Unfortunately it does not look correctly what I want. For example the numbers are not correctly placed and the text is missing at the end. And ...
Test's user avatar
  • 559
0 votes
0 answers
26 views

Seaborn barplot - AttributeError: 'list' object has no attribute 'bar_label' [duplicate]

I am trying to run this cell of code to show values on my seaborn plot, and I am getting the following error sns.set(rc={'figure.figsize':(10,10)}) ax = sns.barplot(x=df1.index,y= df1.values,palette = ...
Anshuman Verma's user avatar
0 votes
1 answer
82 views

Putting two seaborn distribution and boxplot side by side in Python [duplicate]

I would like to create two different Seaborn plots: a distribution plot and a boxplot, appearing side by side. This is the code I have: import numpy as np np.random.seed(3) import seaborn as sns ...
Minh Chau's user avatar
-2 votes
0 answers
29 views

Getting error while trying to load seaborn dataset after updating pip in jupyter notebook [duplicate]

import seaborn as sns sns.load_dataset("iris") ConnectionResetError Traceback (most recent call last) File ~\anaconda3\lib\urllib\request.py:1346, in ...
satishkumar mugi's user avatar
-1 votes
1 answer
26 views

Seaborn legend generated with hue breaks on melted dataframe [duplicate]

Problem I have following problem (which occured when I was trying to work on some melted df's). The problem is that when I am trying to manually set labels to melted df there appears to be one ...
piotre10's user avatar
-1 votes
1 answer
44 views

How to decrease saturation of the bands in seaborn.lineplot?

I would like to keep the MEAN value in the plot the same color, and only change the saturation of the bands around the mean value, specifically make it more transparent/lighter. How to achieve that? ...
Liubove's user avatar
  • 53
-1 votes
1 answer
25 views

When plotting my own pd.dataframe in seaborn, and trying to reposition the axis--the axis disappears

my problem is that I want to plot my data, and want the axes X and Y to intersect at (0,0). But when I do ax.spines['bottom'].set_position(('data',0)), the X axis disappears. The following code ...
Liubove's user avatar
  • 53
-1 votes
2 answers
43 views

How to plot two y-axis barplot using seaborn

I need to plot a bar chart using seaborn with two y-axis (y1 column on the left y-axis and y2 column on the right y-axis) but I have no idea how to make it. Please see the following written code the ...
hamid mohebzadeh's user avatar
0 votes
0 answers
46 views

How to change the colour of certain boxplots while hue is already in use [duplicate]

I am trying to plot my data which is already split by hue, but I want the first and forth boxplots coloured in red to show that they are differentially expressed. Having the hue already assigned to ...
Jeanie's user avatar
  • 21
-2 votes
0 answers
30 views

How to plot with a different marker, style and colour?

I'm reading in from an excel file but need to plot a graph using a different style based on the author who produced the data, different colour based up on the structure mentioned and a different ...
Alexander Beale's user avatar
-1 votes
2 answers
44 views

How can I use errorbar=('ci', False)? [duplicate]

---Skip code--- fig,(ax0,ax1) = plt.subplots(1, 2, figsize=(22, 10)) seasonal_plot(X.loc['2017'], y='sales', period="week", freq="day", ax=ax0) ax0.set_title('Seasonal Plot (week/...
Bon's user avatar
  • 9
0 votes
1 answer
46 views

How to produce barplot in bins?

I produce a barplot like this: sns.barplot(data=number_counts, x="number", y="counts") number_counts is a dataframe that looks like this: number counts 1 7 2 8 3 10 4 12 5 14 6 9 ...
Caterina's user avatar
  • 867
-1 votes
0 answers
28 views

I installed mplcursors but it is not working

I am trying to hover and show all x and y results from this, but I cannot do it. I was able to install mplcursors how can I hover over the points and get the results? My code is: fig = plt.subplots(...
Letty's user avatar
  • 11
0 votes
1 answer
27 views

Unable to set custom timestamp xticks in seaborn lineplot [python]

My dataframe looks like this: We see category values for a given Date/Time timestamp, showing year, month, day, and the time. Plotted as a lineplot in seaborn, the x-axis looks like this: Here we ...
LostinSpatialAnalysis's user avatar
-1 votes
2 answers
52 views

How to make line segments transparent based on value using seaborn in python

I am using the following example code presented by user "dnswlt" for creating a multiple lineplot using seaborn in python: num_rows = 20 years = list(range(1990, 1990 + num_rows)) ...
LostinSpatialAnalysis's user avatar
-1 votes
0 answers
18 views

Trying to set unique lines in line chart to be dashed using seaborn in python

I am using the following example code presented by user "dnswlt" for creating a multiple lineplot using seaborn in python: num_rows = 20 years = list(range(1990, 1990 + num_rows)) ...
LostinSpatialAnalysis's user avatar
-1 votes
1 answer
42 views

Use different colors for different parts of a line in seaborn lineplot

Related to the accepted answer of this question: Exclude subplots without any data and left-align the rest in relplot Is there a way to use the seaborn lineplot such that values in certain ranges are ...
user308827's user avatar
-1 votes
0 answers
16 views

Confusion Matrix for 3x3 [duplicate]

My coding actually already running properly however whenever I run it only shows 1 part. The picture of the results I want the percentage all been seen not only on Positive part only, I try many times ...
Nur Hidayah Athira's user avatar
0 votes
0 answers
49 views

Fix TypeError when creating a bar chart and count plot using pandas, matplotlib, and seaborn?

How to fix the TypeError in the following code using pandas, matplotlib, and seaborn libraries to create a bar chart and count plot for the 'Sex' and 'Survived' columns of the DataFrame df_train? ...
Aidan's user avatar
  • 1
-1 votes
0 answers
33 views

how can get the churn by agency more than 700 agency without using countplot

i'am trying to get the churn by agency, the number of agency is more than 700, iam using the countplot and that's what i get enter image description here Can anyone help me please, how else can I do ...
FATIMA's user avatar
  • 1
0 votes
0 answers
36 views

The seaborn doesn't display the correct color when I have set the RGB hex code [duplicate]

I have run the following code in the Ubuntu server with Jupyter notebook. I actually want the color to be '#3a923a', but it appears to be '#458745'. Can someone help me? import seaborn as sns import ...
YuMO's user avatar
  • 1
0 votes
2 answers
77 views

How to produce a scatter plot with markers and colors determined by categories in different columns

I want to plot a dataset with different clusters. import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.cluster rng = np.random.default_rng(seed=5) df_1_3 = pd....
HarryKane's user avatar
  • 139
2 votes
0 answers
96 views

How to vertically align table values to middle

I created a seaborn box plot with a summary stats table below the plot with the following code: #Packages import pandas as pd from pandas.plotting import table import matplotlib.pyplot as plt import ...
dean's user avatar
  • 21
-1 votes
0 answers
39 views

How do I correctly display Legend handles? [duplicate]

I can't make a legend for a lineplot display correctly. One handle displays correctly, but the second one is the wrong color and shape (see image). This is my code for the plot: sns.lineplot(x="...
ConfusedPsychologist's user avatar
0 votes
0 answers
38 views

Reorder dendrogram leaves to match grouping

I've stumbled upon the following issue when trying to represent 2 clusterings at the same time: I used sns.clustermap to generate a heatmap with hierarchical clustering. In addition, I performed ...
Rob Strasser's user avatar
-1 votes
0 answers
30 views

How to add value labels to a bars in a subplot [duplicate]

fig, ax = plt.subplots(1,2,figsize=(8,4)) train_dt['Embarked'].value_counts().plot.pie(ax=ax[0], shadow=True, autopct='%1.1f%%') ax[0].set(title='Embarked', ylabel='') sns.countplot(data=train_dt, ...
Bon's user avatar
  • 9
0 votes
0 answers
27 views

The value labels in seaborn countplot / factorplot are displayed as values in other graphs [duplicate]

fig, ax = plt.subplots(figsize=(4,3)) sns.countplot(data=train_dt, x='Pclass', ax=ax) abs_values = train_dt['Pclass'].value_counts() rel_values = train_dt['Pclass'].value_counts(normalize=True)....
Bon's user avatar
  • 9
2 votes
3 answers
176 views

How to format heatmap annotation floats to only show the decimal component

I have floats and I'm interested in just the decimal places of them because the integer part is not important (and always will be the same in my problem). I have to use string formatting because the ...
ranemak's user avatar
  • 97
0 votes
0 answers
46 views

My jupyter notebook plots aren't displayed

I’m using an Advertising Dataset for linear Regression. I am doing Exploratory Data Analysis on data while doing so i am not getting graph displayed in Jupytor Notebook. both boxplot and sns,pairplot ,...
SURESH MANI's user avatar
-2 votes
0 answers
27 views

Catplot legend =False but plt.legend not displaying now [duplicate]

i have this Catplot that has been working with legend set to False g=sns.catplot(x='Plan Term', y=y4,data =dfPlotCI,kind='strip', hue='Product',col='Profile',row='Sum Assured', ...
murfyang's user avatar
0 votes
1 answer
40 views

import seaborn displays error: Import "seaborn" could not be resolved Pylance (reportMissingImports)

I am new prgrammer, using VScode and Ubuntu for python. I have installed seaborn from Ubuntu by "pip install seabron". But when I am running from VSCode yellow marked warning displays "...
SKB's user avatar
  • 1
-1 votes
0 answers
33 views

Adding arrows to sns lineplot with discrete data [duplicate]

cps_df = pd.DataFrame(columns=['CP1', 'CP2', 'pair_id', 'player_id', 'phase_id', 'only_player_id', 'only_phase_id'], data=np.column_stack((sampled_coords, ...
guckmalmensch's user avatar
0 votes
0 answers
59 views

Get timestamps between two timestamp type columns , explode and plot as a shaded area between the given timestamps [duplicate]

Here is what my dataframe looks like: Switch| start| end | OFF |2021-11-14 16:00:22 |2021-11-14 16:00:46 OFF |2021-11-14 16:01:19 |2021-11-14 16:01:42 ON |2021-11-14 16:02:...
NoviceB's user avatar
  • 11
1 vote
1 answer
60 views

How to annotate bars with 0 counts when there's no data for the category

I have code using seaborn catplot, to draw categorical plots onto a FacetGrid. I am using a countplot in the catplot function, hence am using kind='count'. The col argument in the catplot is set to ...
Jonathan Ng's user avatar
0 votes
0 answers
39 views

How can I manipulate the legend on a distribution? [duplicate]

I'm new to python and I'm having a hard time manipulating the legend in a distribution plot. The legend takes up its own space on the plot rather than just being on top of it. I don't like the way ...
OranC's user avatar
  • 3
0 votes
1 answer
28 views

Adding hatches for certain rows and columns in clustermap

I have used seaborn.clustermap() to plot clustermap as shown below labels = ["a", "b", "c", "d", "e", "f", "g", "h", &...
crx91's user avatar
  • 473
1 vote
1 answer
108 views

How to plot columns with a value and x-y positions as a color grid in subplots

In R I would do the following to make a grid of facets with a raster-plot in each facet: # R Code DF <- data.frame(expand.grid(seq(0, 7), seq(0, 7), seq(0, 5))) names(DF) <- c("x", &...
Phann's user avatar
  • 1,305
-1 votes
1 answer
27 views

How to separate values dots of stripplot for my two sub categories violin plots? [closed]

I have two sub categories 'Stage 10' and 'Stage 13' under the main category 'Control'. I want to show the value dots with stripplot. The problem is that the value dots now are at the middle between ...
Guy Hadary's user avatar
2 votes
1 answer
79 views

How to create a stripplot with multiple subplots [duplicate]

This is my example data data = {'pro1': [1, 1, 1, 0], 'pro2': [0, 1, 1, 1], 'pro3': [0, 1, 0, 1], 'pro4': [0.2, 0.5, 0.3, 0.1]} df = pd.DataFrame(data) I want to make striplot ...
jacobdavis's user avatar
0 votes
0 answers
17 views

How to plot error bars in a Seaborn FacetGrid? [duplicate]

I need to plot error bars for this facetgrid in a pandas dataframe on a Seaborn FacetGrid This is the code I am using g = sns.FacetGrid(df1_melted,col='AA', col_wrap=4) g = g.map_dataframe(sns.barplot,...
Leandro's user avatar
  • 11

1
2 3 4 5
192