I’m using seaborn’s kdeplot to draw the distribution of my data. I want to divide the shaded area under the line into three parts, showing the “high” percentile and the “low” percentile. It would be ideal if I can color the shaded area with three different colors. Any idea how I can go about doing that? I want it to
Tag: seaborn
seaborn pointplot and boxplot in one plot but shifted on the x-axis
I want to plot both a boxplot and the mean in one figure. So far my plot looks like this using these lines of code: I would like to shift my mean ‘x’ markers a bit to the right so that the errorbars don’t overlap with the whiskers from the boxplot. Any idea how to do that? A bonus question:
AtributeError: ‘module’ object has no attribute ‘plt’ – Seaborn
I’m very new with these libraries and i’m having troubles while plotting this: And i’m getting this output: I’m running this in my Jupyter Notebook with Python 2.7.12. Any ideas? Answer sns.plt.show() works fine for me using seaborn 0.7.1. Could be that this is different in other versions. However, if you anyways import matplotlib.pyplot as plt you may as well
Plotting multiple boxplots in seaborn
I want to plot boxplots using seaborn in pandas because it is a nicer way to visualize data, but I am not too familiar with it. I have three dataframes that are different metrics, and I want to compare the different metrics. I will loop through the file paths to access them. The dfs for each of the metrics are
Python, Seaborn FacetGrid change titles
I am trying to create a FacetGrid in Seaborn My code is currently: This gives my the Figure Now, instead of “ActualExternal =0.0” and “ActualExternal =1.0” I would like the titles “Internal” and “External” And, instead of “ActualDepth” I would like the xlabel to say “Percentage Depth” Finally, I would like to add a ylabel of “Number of Defects”. I’ve
How to move the legend in Seaborn FacetGrid outside of the plot
I have the following code: This results in the following plot: How can I move the legend outside of the plot? Answer According to mwaskom’s comment above, this is a bug in OS X. Indeed switching to another backend solves the issue. For instance, I put this into my matplotlibrc:
Seaborn pairplot legend – how to control position
I would like to move the Seaborn pairplot legend outside the scatter plot matrix. The official docs don’t give a keyword legend. I am trying to plot the legend outside the plot in 3 different locations simultaneously: bottom center, top center, right center I have tried this: The output of the above code is this file: . All 3 legends
Get data points from Seaborn distplot
I use to plot a univariate distribution of observations. Still, I need not only the chart, but also the data points. How do I get the data points from matplotlib Axes (returned by distplot)? Answer You can use the matplotlib.patches API. For instance, to get the first line: This returns two numpy arrays containing the x and y values for
How To Plot Multiple Histograms On Same Plot With Seaborn
With matplotlib, I can make a histogram with two datasets on one plot (one next to the other, not overlay). This yields the following plot. However, when I try to do this with seabron; I get the following error: So then I try to add some color values: And I get the same error. I saw this post on how
How to plot multiple linear regressions in the same figure
Given the following: This will create 2 separate plots. How can I add the data from df2 onto the SAME graph? All the seaborn examples I have found online seem to focus on how you can create adjacent graphs (say, via the ‘hue’ and ‘col_wrap’ options). Also, I prefer not to use the dataset examples where an additional column might