seaborn

Control individual linewidths in seaborn heatmap

岁酱吖の 提交于 2019-12-12 11:31:52
问题 Is it possible to widen the linewidth for sepcific columns and rows in a seaborn heatmap? For example, can this heatmap import numpy as np; np.random.seed(0) import seaborn as sns; sns.set() uniform_data = np.random.rand(10, 12) ax = sns.heatmap(uniform_data, linewidths=1.0) be transformed into something like this: 回答1: It's possible, but may be a lot of work. A possible solution might look like shown below. It involves plotting 6 different heatmaps and adjusting the spacings such that it

Plotting two columns of dataFrame in seaborn

蹲街弑〆低调 提交于 2019-12-12 11:13:14
问题 I'm trying to create a bar chart in seaborn that displays values for two variables(Weight, Variance) for each row (Factor) in my data frame. Here is what my data looks like: Factor Weight Variance Growth 10% 0.15 Value 20% 0.35 Here is my code: fig=plt.figure(figsize=(10,10)) ax1=fig.add_subplot(221) sns.barplot(x=df.index, y=df[['Weight', 'Variance']], ax=ax1) The above throws back an error every time that I can't debug. What I am trying to achieve is have one plot, that shows two colored

How to combine two seaborn plots?

耗尽温柔 提交于 2019-12-12 09:12:10
问题 From the seaborn docs, the following snippet will produce the plot below: import numpy as np import pandas as pd import seaborn as sns sns.set(style="white") # Generate a random correlated bivariate dataset rs = np.random.RandomState(5) mean = [0, 0] cov = [(1, .5), (.5, 1)] x1, x2 = rs.multivariate_normal(mean, cov, 500).T x1 = pd.Series(x1, name="$X_1$") x2 = pd.Series(x2, name="$X_2$") # Show the joint distribution using kernel density estimation g = sns.jointplot(x1, x2, kind="kde", size

How to base seaborn boxplot whiskers on percentiles?

坚强是说给别人听的谎言 提交于 2019-12-12 08:55:52
问题 I am using a boxplot to show differences in the distribution of values between groups. The lower(25) and higher (75) percentiles and the median are indicative of the distribution and main differences between groups. The whiskers are however less clear. By default in matlibplot or seaborn, the whiskers of a boxplot are a representation of a multiple (default: 1.5) of the innerquartile range (IQR), which is the range of values covered by the inner box. Points outside this range will be

Multiple graphs on the same plot in seaborn

丶灬走出姿态 提交于 2019-12-12 07:58:10
问题 I'm trying to plot a bar style "factorplot" for some data, then plot a regular point style "factorplot" for my fit of that data on top of it. So for the data plot I can simply do : sns.factorplot(x='x',y='yData',data=dataFrame,kind='bar') And for the model plot I can simply do : sns.factorplot(x='x',y='yModel',data=dataFrame,kind='point') The problem is that if I then do : sns.plt.show() I get 2 separate figures instead of just one. Is there any simple way to tell seaborn to just plot them on

AtributeError: 'module' object has no attribute 'plt' - Seaborn

风格不统一 提交于 2019-12-12 07:25:13
问题 I'm very new with these libraries and i'm having troubles while plotting this: import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np import random df5 = pd.read_csv('../../../../datos/tiempos-exacto-variando-n-m0.csv', sep=', ', engine='python') print(df5) df5['n'] = df5['n'].apply(lambda x: x**2) sns.jointplot(df5['n'], df5['tiempoTotal'], kind="reg") sns.plt.show() And i'm getting this output: n m tiempoTotal 0 1 0 2274 1 2 0 3370 2 3 0 5709 3 4 0 8959

Seaborn distplot: y axis problems with multiple kdeplots

♀尐吖头ヾ 提交于 2019-12-12 06:18:27
问题 I am currently plotting 3 kernel density estimations together on the same graph. I assume that kdeplots use relative frequency as the y value, however for some of my data the kdeplot has frequencies way above 1. code I'm using: sns.distplot(data1, kde_kws={"color": "b", "lw": 1.5, "shade": "False", "kernel": "gau", "label": "t"}, hist=False) Does anyone know how I can make sure that the kdeplot either makes y value relative frequency, or allow me to adjust the ymax axis limit automatically to

turn off axis, keep ticks

依然范特西╮ 提交于 2019-12-12 04:49:25
问题 I am plotting an image using plt.imshow() using the seaborn add on.... from astropy.io import fits import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set_style(style='white') #turn off grid def plotter(): mapy = np.zeros((100,100)) pf = 2.8 #my physical pixel size areaX = mapy.shape[0]/2*pf # half of the area! areaY = mapy.shape[1]/2*pf # half of the area! cmapz ='Reds' fig = imshow(mapy,interpolation='spline16',origin='lower',cmap=cmapz,extent=[-areaX*pf,areaX*pf,

Error importing seaborn in ipython notebook - working in ipython

醉酒当歌 提交于 2019-12-12 04:05:26
问题 I have a somewhat similear problem as this guy: when I want to import seaborn in my ipython notebook I get an import error. When I try to import seaborn in ipython console it works! What is the problem? ImportError Traceback (most recent call last) <ipython-input-6-085c0287ecb5> in <module>() ----> 1 import seaborn /usr/lib/python3.4/site-packages/seaborn/__init__.py in <module>() ----> 1 from .rcmod import * 2 from .utils import * 3 from .palettes import * 4 from .linearmodels import * 5

Seasborn Distplot goes unresponsive

你。 提交于 2019-12-12 03:36:57
问题 I am trying to plot a simple Distplot using pandas and seaborn to understand the density of the datasets. Input #Car,45 #photo,4 #movie,6 #life,1 #Horse,14 #Pets,20 #run,67 #picture,89 The dataset has above 10K rows, no headers and I am trying to use col[1] code import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns df = pd.read_csv('keyword.csv', delimiter=',', header=None, usecols=[1]) #print df sns.distplot(df) plt.show() No error as I can print the