# Questions tagged [seaborn]

Seaborn is a Python visualization library based on matplotlib. Its primary goal is to provide a concise, high-level interface for drawing statistical graphics that are both informative and attractive.

**0**

votes

**0**answers

5 views

### Boxplot facet grid sharing x variable (string) with one column, multiple rows

So I want to build a table of Boxplots where each row is a y variable, and all plots share the same x variable. I've got 7 variables I want to represent as boxplots in the y that all share the same ...

**0**

votes

**1**answer

8 views

### plot percent bar in seaborn from dataframe

I have a dataframe which looks like :
|---------------------|------------------|------------------|
| Gender | Male | Female |
|---------------------|---------------...

**0**

votes

**1**answer

26 views

### how to prevent seaborn from smoothing the histogram when plotting a density plot using seaborn.distplot?

Here is the problem I'm facing for a while now. I'm trying to plot a density plot (i.e. a smoothed approximation of a histogram plot) using seaborn.distplot() and I obtain the following figure:
The ...

**0**

votes

**0**answers

15 views

### confusion matrix is not being annotated in python3

I am trying to make a confusion matrix in python. I am able to generate a confusion matrix but it won't put the percentages in the cell.
import numpy as np
import seaborn as sns
import matplotlib....

**1**

vote

**1**answer

31 views

### Seaborn stripplot with violin plot bars in front of points

I would like to draw a violin plot behind a jitter stripplot. The resulting plot has the mean/std bar behind the jitter points which makes it hard to see. I'm wondeing if there's a way to bring the ...

**0**

votes

**1**answer

13 views

### Set_xlabel is in invalid in ax[0, 0] when drawing 4 subplots in one plot

I get some codes as followed and I want to draw 4 subplots in one plot.
fig, ax = plt.subplots(nrows=2, ncols=2)
# ax[0, 0]
sns.countplot(train_df['Survived'], ax=ax[0, 0])
ax[0, 0].set_xlabel('...

**0**

votes

**1**answer

27 views

### How to display axis tick labels over plotted values using matplotlib and seaborn?

I am using matplotlib and seaborn in order to scatter plot some data contained in two arrays, x and y, (2-dimensional plot). The issue here is when it comes to displaying both axis labels over the ...

**0**

votes

**0**answers

20 views

### Adding more colors to Dendrogram Clusters

So I'm trying to make some code where I can label my clusters with different colors in my dendrogram. I am currently using cmap to add more colors, the only problem is depending on the dataset the ...

**0**

votes

**1**answer

19 views

### How to plot animated scatterplot using seaborn / matplotlib changing colour of fixed or moving marker over time

I am trying to plot the readings of several air pollution sensors over time. In the first case the location (lat, long) of each sensor is fixed on the scatterplot but at different times of the day, or ...

**-1**

votes

**1**answer

25 views

### How count rows by specific year and month, and draw on the bar graph with use seaborn?

I have table(in .csv file):
id date
1 20-04-2016
2 16-06-2017
3 04-12-2016
4 01-06-2017
5 01-09-2015
6 08-04-2016
I want count rows by year = '2016', month = '04' ...

**0**

votes

**0**answers

23 views

### how to modify seaborn violin plot legend

I have created a simple violin plot from a bands DataFrame (df10 below) using seaborn:
fig, ax = plt.subplots(figsize=(10,4))
ax = sns.violinplot(x='z', y='z_fit', hue='new_col', data=df10, cut=0, ...

**0**

votes

**1**answer

26 views

### How to create a visualisation using seaborn

I've loaded the data from a csv file in jupyter notebook. After cleaning and imputing the dataframe I'm trying to plot some visualisations. However I'm not sure if I'll need to create a pivot table ...

**0**

votes

**0**answers

14 views

### How do I add indicator like star to show significant plots drawn by catplot in seaborn?

I am using catplot in seaborn package to plot an expression of a bunch of genes in different condition (figure seborn1). I would like to add strikes to the column to show the significant differential ...

**2**

votes

**1**answer

56 views

### R function geom_freqpoly equivalent in Python to plot frequency polygons

How to plot the frequency polygons in Python?
For example, I can plot density plot like this:
import pandas as pd
x = (1.5,1.5,1.5,1.5,1.5,1.5,1.5,
2.5,2.5,2.5,
3.5,3.5,3.5,3.5,3....

**0**

votes

**1**answer

30 views

### Matplotlib loop through axes in a seaborn plot for multiple subplots

I'd like to create five subplots (one for each category in a specific column of a dataframe) on a seaborn histogram (distplot).
My dataset is:
prog score
cool 1.9
cool 3.7
yay 4.5
yay 2.6
neat 1.4
...

**1**

vote

**1**answer

51 views

### How to create multiple line graph using seaborn and find rate?

I need help to create a multiple line graph using below DataFrame
num user_id first_result second_result result date point1 point2 point3 point4
0 0 1480R ...

**1**

vote

**1**answer

24 views

### overlay multiple calls to seaborn's FacetGrid with different hue groupings

Using seaborn's FacetGrid, I'd like to update the 'hue' grouping parameter between multiple mapping calls. Specifically, I initially have a custom plotting function that takes a 'hue' grouping, on top ...

**3**

votes

**1**answer

40 views

### Separating seaborn barplot with two colors

I have the following dataset:
words = ['upvoted', 'upvote', 'f***', 'reimer', 'feminists', 'censorship',
'wet', '0001f914', 'turtle', '0001f602', 'vegans', 'thumbnail',
'lobby', 'mods', ...

**-2**

votes

**0**answers

54 views

### Problems with making a heatmap work in Python

I'm trying to make a heatmap out of a DataFrame. The DataFrame looks like:
https://imgur.com/a/K0Davwi
I created with data and gathered from the internet.
The dataframe's datatypes are:
Apr/16/...

**0**

votes

**2**answers

38 views

### Returning one value from function in Python and plotting it on a heatmap

I have used the following code to produce a heatmap for a given function. Here it is calculating the global lyapunov exponent for a variation of the logistic map - I've added the parameter of p. Where ...

**0**

votes

**1**answer

28 views

### Pandas subplot layout not working in this case

I was plotting some scatter plot of mpg dataset from the seaborn library. I was wondering if it is possible to plot the odd number of subplots in python?
import pandas as pd
import seaborn as sns
df =...

**0**

votes

**0**answers

23 views

### Seaborn scatterplot problem: 'module' object has no attribute 'to_rgba' [duplicate]

I can not reproduce a seaborn scatterplot anymore. Also the example plot on the help homepage doesn't work:
import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
tips = sns.load_dataset("...

**1**

vote

**3**answers

25 views

### How to plot vertical lines on an already plotted line plot?

I am trying to plot vertical lines in a line lot that I have already plotted.
Just a small portion of my data looks as follows:
EscAct_Curr_A StepID Time_Elapsed
0.122100122272968 1 0.0
0.0 ...

**4**

votes

**1**answer

54 views

### How to identify outliers with density plot

I'm trying to identify outliers with my density plot. I am currently using the seaborn library to plot my data. How would I go about identifying outliers? I have been looking at implementing the Z-...

**3**

votes

**1**answer

28 views

### Show confidence interval in legend of plot in Python / Seaborn

I am generating some scatter plots with linear regression and confidence interval using seaborn on Python, with the sns.regplot function. I could find a way to show the Regression line in the legend, ...

**-3**

votes

**1**answer

36 views

### How to Make a Beautiful Stacked 3D Plot [closed]

I am looking to make a plot where:
Plot is composed of a group of 2D plots, stacked in 3D.
The height of the line is indicated by the color.
This is what I mean:

**-1**

votes

**1**answer

37 views

### Add vertical line to multi horizontal bar-chart

I am generating a multi bar chart as a horizontal bar chart, and what I need to do now is to annotate (basically create a vertical line) in each of the horizontal bars at a specific place (x-axis ...

**0**

votes

**1**answer

28 views

### Multi Label Text Data Visualization

I have multi-label text data. I want to visualize this data in python in some good graph to get an idea how much overlapping exist in my data and also wanted to know if there is any pattern exist in ...

**-1**

votes

**0**answers

35 views

### How to do a forest plot in python?

I am looking to create a plot that has:
labels
lines to indicate range of values
marker for the mean somewhere on each line
The problem is that all the functions I could find use a 'box plot' which ...

**-1**

votes

**0**answers

11 views

### How can I plot this as an scatter chart where x axis shows day_of_week and y axis shows average number of visitors in a day when it is holiday or not?

I want to plot this as a scatter chart.
I have tried to put df.['day_of_week'] in x-axis and mo in y-axis. But it says, TypeError: object of type 'int' has no len()
enter image description here
df=...

**0**

votes

**0**answers

23 views

### How can the height of seaborn boxplots be changed?

Is there a way to change the height in seaborn's boxes in the boxplot in a way to use a custom function instead of the quartiles (SEM, SD...)? Either by a function directly or by a separate column in ...

**1**

vote

**1**answer

37 views

### How to create a simple custom heatmap?

I want to create a Heatmap from pandas DataFrame df. The df has two columns:
name test
aa False
bb False
cc True
dd False
The heatmap should include name values in X axis, and test ...

**0**

votes

**1**answer

32 views

### Python: seaborn barplot of grouped data

This is my dataset:
I'd like to use seaborn to plot each column, just like pandas would do by default:
Any clue?
Thanks in advance

**3**

votes

**1**answer

36 views

### How to correctly superimpose a matplotlib.errorbar onto a seaborn.barplot?

I'm trying to superimpose some experimental data over some simulated data in a seaborn.barplot. The issue is that I cannot figure out how to extract the bar locations on the x axis. Here's a minimal ...

**0**

votes

**1**answer

51 views

### Heatmap or other two variable histogram option?

I have a dataframe with two columns, the first one can have an integer from 0-15, the other one can have an integer from 0-10.
The df has approximately 10,000 rows.
I want to plot some sort of grid, ...

**0**

votes

**1**answer

35 views

### How can I integrate Seaborn plot into Tkinter GUI

I am trying to plot using Seaborn in Tkinter. My approaches so far were different variations of this and I could not get it to work.
I tried the matplotlib.use("Agg"), which works fine one the normal ...

**0**

votes

**0**answers

18 views

### Python pie chart using matplotlib [closed]

I hav calculated the sum of claim amount by grouping gender wise and segment wise(sub division lik gold,silver,diamond).
I hav to plot a pie chart containg percentage of claim amount divided in ...

**0**

votes

**0**answers

47 views

### seaborn library is not updating barplot?

I'm using seaborn to draw a barplot. There's one group(nan) that I don't want to see on x-axis, so I filtered it. But, I am still seeing it. I can print and see that nan group has indeed been filtered(...

**0**

votes

**1**answer

25 views

### Setting ticks in logscale with seaborn

I have two lists with integer values and I want to plot two histograms of them side by side using seaborn in python:
fig, [ax1, ax2] = plt.subplots(nrows=1, ncols=2, figsize=(16,6))
sns.set(style="...

**-1**

votes

**1**answer

38 views

### How set all Nan values in an excel file to 0 at once [duplicate]

i want to display a chart between price and year (data is extracted from an csv file) there are more than 2500 data entries and some of them are NaN. My graph is all messy looking.
Ik my problem is ...

**0**

votes

**0**answers

25 views

### Seaborn Barplot not showing confidence intervals

I have the following dataframe (perc):
BI-RADS assessment Non-null Null
0 1.0 0.55 1.00
1 2.0 2.1 2.6
2 3.0 3.7 8....

**2**

votes

**1**answer

25 views

### What is Matplotlib's alternative for countplot from seaborn?

I have the following data:
male 843
female 466
Name: Sex, dtype: int64
I plotted bar plots for the same using countplot from seaborn, and it worked.
But I would like to know what could be ...

**0**

votes

**1**answer

35 views

### Scaling a figure to show long annotations

I have annotated a color bar to a categorical heatmap with lengthy names. When plotting, those names are not fully visible. plt.tight_layout() breaks the arrangement of elements, sometimes not showing ...

**0**

votes

**1**answer

21 views

### How to subplot a matplotlib table by using a custom plot function?

I am trying to create a function that takes axes of a subplot as a parameter and return a matplotlib table.
I was able to do this for barplots and lineplots using the code here. But trying the same ...

**0**

votes

**0**answers

40 views

### x-axis is shifted to the right?

The x-axis is shifted to the right and not sure why. I've used plt.xlim(left=0) but the distribution line still comes from the negative side even though there are no negative values?
Here is the code:...

**1**

vote

**1**answer

36 views

### Change seaborn boxplot line rainbow color

I found this beautiful graph online (apparently made with plotly) and wanted to recreate it with seaborn.
This is my code so far:
import pandas as pd
import seaborn as sns
data = ...
flierprops = ...

**0**

votes

**1**answer

29 views

### How to align each set of bar charts in the middle? I am trying to create a tornado chart

The question
My question has nothing to do with the tornado package.
I'd like to understand if there is a way to produce tornado charts in Python - I presume using matplotlib and seaborn, but any ...

**2**

votes

**1**answer

31 views

### Seaborn plot with second y axis

i wanted to know how to make a plot with two y-axis so that my plot that looks like this :
to something more like this by adding another y-axis :
i'm only using this line of code from my plot in ...

**0**

votes

**2**answers

13 views

### Seaborn subpots - share x axis between line and bar chart

I'm trying to create 2 stacked charts via Seaborn in a Juyter lab notebook; one of them being a line chart, the other one being a bar chart. Both should share the same x-axis.
%matplotlib widget
dt =...

**1**

vote

**3**answers

51 views

### matplotlib: change axis ticks of ndim histogram plotted with seaborn.heatmap

Motivation:
I'm trying to visualize a dataset of many n-dimensional vectors (let's say i have 10k vectors with n=300 dimensions). What i'd like to do is calculate a histogram for each of the n ...