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
0answers
17 views

How Can I Set The Range Of the X and Y Axis For A Heatmap?

I am trying to set the axes for both x and y but every time I try it, the heatmap shrinks to a corner of the plot. I try plt.xlim(0, 60) plt.ylim(0, 30) I've also tried: ax.set_ylim(0, 30) ax....
0
votes
2answers
17 views

Assign Color Using Seaborn Based on Column Name

I'm trying to create 4 types of plots summarizing my data. I've included code to create 2 of the types of charts. I'm iterating over the crayon seaborn color palette to get a unique color for each ...
0
votes
0answers
10 views

Python Boxplot: How to Have the Boxes be [0, 100] and Repress Whiskers?

I am trying to build a chart with "Actual" data (represented by normal boxplots), with the "Bands" data side-by-side (represented by a rectangle with a line where the median would be). I used a ...
-2
votes
0answers
14 views

Is there any library/function in python or specifically in matplotlib/seaborn, which works exactly the same as mvtsplot in R? [on hold]

I have to make mvtsplot but I want to do it in python(for many reasons), so if there exists a library or code which can be useful, please let me know. I tried some basic google search but couldn't ...
0
votes
0answers
6 views

Seaborn displot, y axis greater than 1 under norm_hist=True [duplicate]

I need some help in this code as I used sns.displot with norm_hist=True However, the y axis far greater than 1. import seaborn as sns import matplotlib.pyplot as plt x = pd.DataFrame([0.235,0.1454,...
0
votes
0answers
14 views

Titles for histograms on diagonal when using seaborn.PairGrid in python for generating a correlation matrix

After investing some time in identifying how PairGrid function I am nearly there. Below is the code that generates the plot that I want with one small detail missing in the histfunc. What I want is ...
-1
votes
1answer
13 views

Seaborn Boxplot - axis color and width

I am using seaborn to create boxplots. How can I modify axis line thickness and color? I don't know where in my code I can fix this issue. I need to change x-axis color and width to make it blue and ...
0
votes
0answers
18 views

Is it possible to set the svg width and height 100% in matplotlib/seaborn

I have a pipeline which is generating 30 individual boxplots svgs using matplotlib + seaborn. I want to visualize them in a 5*6 grid. Since I want to be able to zoom on specific plots I thought about ...
0
votes
1answer
22 views

Seaborn lineplot hue input could not be interpreted

I am trying to plot my dataframe as a lineplot. The data is 2D movement data of x and y coordinates. The dataframe has a column which identifies the data of each individual by a unique ID and a column ...
0
votes
0answers
26 views

seaborn graphs are blank when used in a figure with matplotlib [duplicate]

Ive created a figure with 3 subplots. One of these is a seaborn countplot, the others are matplotlib plots. The seaborn plot works if its on its own, or if there is no other plot after it in the ...
-2
votes
0answers
16 views

Getting blank plots on using hue=“strings”

sns.pairplot(gapminder2, hue='Species') Output is coming blank plots with error: key-error: "SPECIES" However, using simple shows plots in blue color: sns.pairplot(gapminder2)
0
votes
1answer
26 views

How do I visualize monthly data?

How do I visualize monthly data in the format shown below? What these 2 charts called? As suggested in the comment, this is possible using heatmap. But I am not able to visualize this data in that ...
1
vote
1answer
37 views

How to add a forth bar on a group barchart using matplotlib and seaborn in Python?

I am trying to create a group barchart to show the accuracy, precision, recall and f1 scores achieved by different machine learning classifiers. The group bar chart works ok when I use three bars per ...
0
votes
0answers
7 views

Does seaborn heatmap share the same colormap scale along multiple plots? [duplicate]

I'm using the following code fig, ax = plt.subplots(1,3, sharey=True, figsize=(7,4)) for i,model in enumerate(models): sns.heatmap(df[i],cbar=False, ax=ax[i]) ax[i].set_ylabel('') ax[i]....
0
votes
0answers
17 views

Get the values for x and hue in seaborn barplot with nested grouping

I created a barplot with nested grouping using seaborn and the hue keyword argument. Is it possible to get the order of the bars (and the corresponding values for x and hue) from the seaborn object ...
0
votes
0answers
23 views

How to create grouped by boxplots of each value in a column

I was trying to create a boxplot as you can see here: so far I was able to boxplot all of the graphs into one but I would like to reproduce the example above. I tried to start by just displaying ...
-2
votes
0answers
27 views

How to plot volatility?Didn't understood this query statement

The problem statement is: You have already calculated the percentage changes in several stock prices. Calculate the 7 day rolling average of the percentage change of any of the stock prices, then ...
0
votes
0answers
22 views

How can I have markers in Time Series Plot with Python Seaborn

I have the following reference plot from Seaborn import seaborn as sns; sns.set() import matplotlib.pyplot as plt fmri = sns.load_dataset("fmri") ax = sns.lineplot(x="timepoint", y="signal", hue="...
0
votes
1answer
26 views

Extract Time from DateTime dataframe column and Plot hourly time with lineplot

As I have a column in DateTime format and want to plot a graph which will show hourly time intervals to find out hours in which users are most active. However, I'm a bit confused with how to plot ...
0
votes
0answers
32 views

Import Error regarding statsmodels in python

I have installed the statsmodels package through pip, because I want to use the seaborn package for plotting cdfs of distributions. So, when I try to run this: import seaborn as sns import numpy as ...
1
vote
1answer
33 views

how to change the xticks to a specific range [duplicate]

I have drawn a countplot as follows: ax, fig = plt.subplots() sns.countplot(user_id_count[:100]) (array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
0
votes
0answers
24 views

How to plot the month/year in the x_axis while plotting distribution curve?

I have the following dataset that I have obtained after manipulating my main dataset: date mean std var 2011-01 1231.9032258064517 372.43266548811295 138706....
-1
votes
1answer
40 views

TypeError('argument must be a string or number')

I am trying to visualize a correlation matrix for categorical variables which are first Hot-Encoded. After that, the code throws me still an error and I am not sure why. X= pandas.DataFrame(A, B, C, ...
0
votes
1answer
22 views

Distplot in seaborn in python

I am working with titanic data-set.For visualizing the distribution of data I am using seaborn plotting methods.But I am not able to understand the arguments of distplot and its final output what it ...
0
votes
1answer
30 views

Avoid Plotting Redundant Pixels?

When I'm making qq-plots (basically a scatter-plot), I frequently use matplotlib, occasionally Seaborn. If I happen to have a few million data-points (let's say 8 million), plotting can take forever. ...
0
votes
1answer
12 views

turn off off fliers in sns.boxplot

I'd like to hide the fliers in sns.boxplot(), but I can't figure out how to do it. I've looked on here and there is not a solution that I can get working. Is there any way to do this?
-1
votes
0answers
20 views

How to plot binned series using index?

Using heart disease date I have binned my age data into groups and I am measuring against the count of Diagnosis for that age group. I am trying to do a lmplot with Seaborn and then train my model. I ...
0
votes
0answers
24 views

how to combine numerical and categorical variables for seaborn heatmap?

I have two dataframes: X : which contains 5 categorical variables (age, gender, city, country, device) Y: which contains 1 numerical variable (sales_amt) They both have the number of rows. Then, I ...
0
votes
1answer
29 views

How to plot line plot with seaborn?

I have a sample data frame shown below. I want to plot each column against the data frame index. x1 = pd.DataFrame() x1['x25'] = df['X'][0:45].reset_index(drop=True) x1['x50'] = df['X'][90:135]....
-1
votes
0answers
17 views

Relative Frequency on Seaborn not working

I am trying to get the relative frequency of the school of the below .. Data set is painters .. sns.distplot(painters['School'], kde=False, norm_hist=True) I get his error: TypeError: unsupported ...
0
votes
0answers
16 views

Get the coordinates of seaborn barplot with nested grouping [duplicate]

I created a barplot with nested grouping using seaborn and the hue keyword argument. I want to draw statistical annotations on this plot. For this I need the x- and y-coordinates for each bar. How can ...
0
votes
0answers
23 views

Giving different colours to different ranges in point plot seaborn

I have a point plot and I want to give colours for different ranges in my y-axis like 0-5 background should be in red, 5-8 should be in yellow and 8-10 should be in Green. So any point in 0-5 will be ...
1
vote
2answers
35 views

Changing hatch color in matplotlib

Thanks for helping me get this graph right! I have another issue now, that I wish to change the color of the hatch lines to grey. I am working with matplotlib version 1.5.3'. I have tried mlp....
0
votes
1answer
32 views

Seaborn - disable xtick interpolation

I'm plotting a dataframe in seaborn with 2 (datetime) points separated by a week. What I want is 2 points on the x axis but seaborn is giving 7 which is messy and confusing. import matplotlib....
0
votes
1answer
27 views

Remove one of the two legends produced in this Seaborn figure?

I have just started using seaborn to produce my figures. However I can't seem to remove one of the legends produced here. I am trying to plot two accuracies against each other and draw a line along ...
1
vote
1answer
33 views

How to create a discrete colormap that maps integers to colors, invariant to range of input data

Let's say I have a vector containing integers from the set [1,2,3]. I would like to create a colormap in which 1 always appears as blue, 2 always appears as red, and 3 always appears as purple, ...
1
vote
1answer
39 views

How to prevent colorbar from moving up/down as heatmap height changes? Matplotlib/seaborn

I am generating a heatmap dynamically and the number of categories on the y and x axes may be different each time. How can I position the colorbar next to the heatmap so that it is always anchored at ...
1
vote
1answer
29 views

How to change the position of a single swarm group

I am plotting a grouped bar plot on which I overlay a swarmplot and errorbars. One of the groups only have one bar, which I want to appear (with the swarm and the errorbar) in the middle of the ...
0
votes
0answers
43 views

Extend matplotlib plots output

I am trying to plot several plots, here is the code: import seaborn as sns import matplotlib.pyplot as plt fig, axes = plt.subplots(round(len(matching)/2), 2, figsize=(20, 25)) fig.subplots_adjust(...
-1
votes
1answer
19 views

How to have stacked sns.barplot without a duplication in the legend? [closed]

g=sns.barplot(x='depth', y='nodes', hue='end id', data=df, palette=sns.color_palette("gnuplot2", 5)) g1=sns.barplot(x='depth', y='initial', hue='end id', data=df, palette=sns.color_palette("gnuplot2", ...
0
votes
1answer
26 views

Seaborn Barplot and Formatting Dates on X-Axis

I am currently working on visualizing datasets with Seaborn and Pandas. I have some time-dependent data that I would like to graph in bar charts. However, I am battling with two issues in Seaborn: ...
0
votes
2answers
20 views

What's the difference between kwargs and e.g. scatter_kws in seaborn?

Since seaborn uses matplotlib for plotting, most (all?) of its functions have some way to pass arguments to the underling matplotlib function that draws the plot. This is a good design that allows ...
0
votes
2answers
37 views

Seaborn set figsize=(x,y) error and warning about tight_layout “tight_layout cannot make axes height small enough to accommodate all axes decorations”

I have a 10-plot FacetGrid chart in Seaborn with slightly overlapping plots. I want to change the size of the overall figure. When I use g.fig.subplots(figsize=(12,12)) in the code below, I get an ...
-2
votes
0answers
32 views

Seaborn heatmap is combining multiple labels as xticks

I'm trying to plot a heatmap that displays diffternt causes of data breaches in a decade alongside the number of induividuals affected. The heatmap is displayed with no errors. However, the xicks is ...
0
votes
0answers
27 views

Plotting between x-axis ticks

I want to create 5 line plots in a single plot whose value lies in intervals of 20 (0-20, 20-40.... 480-500). How do I create plots in matplotlib so that the y-axis values lie between values of 0-20 ...
0
votes
1answer
32 views

Error installing seaborn and sklearn on Jupyter Notebook

I'm trying to install seaborn and sklearn on Jupyter Notebook but I always get the error: ModuleNotFoundError: No module named ... for these two libs. These were my steps: $ conda create --name ...
0
votes
1answer
23 views

Error 404 - coding with library given by the python website

I am using the code given by the python graph website: https://python-graph-gallery.com/110-basic-correlation-matrix-with-seaborn/ A simple code, I was testing the pairplot function. Just did the copy-...
0
votes
1answer
30 views

Incorrect marker sizes with Seaborn relplot and scatterplot relative to legend

I'm trying to understand how to get the legend examples to align with the dots plotted using Seaborn's relplot in a Jupyter notebook. I have a size (float64) column in my pandas DataFrame df: sns....
-2
votes
0answers
17 views

How to plot violinplot of weighted data?

How plot violinplot with weighed data using Seaborn or Matplotlib?
1
vote
1answer
17 views

How to set x axis ticklabels in a seaborn plot?

I am unable to set x axis ticklabels for a seaborn line plot correctly. import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt df = pd.DataFrame({'a':np.random....