seaborn

How to annotate text on horizontal Seaborn barplot?

余生长醉 提交于 2020-07-23 04:21:18
问题 I have the problem that as soon as I want to annotate my horizontal bars there will be some error message: posx and posy should be finite values Than I looked into the code and surprisingly I got some nan values which only appear when the hue parameter is used. Code: ax = sns.barplot(x="Points", y="Characters", hue="Average Speeds", data=albion_dataset, palette="Set1", dodge=False) for p in ax.patches: width = p.get_width() print(width) Output: nan nan 2.57562 nan nan nan nan 1.526325 nan ...

Python Seaborn Chart - Shadow Area

左心房为你撑大大i 提交于 2020-07-21 19:04:01
问题 Sorry to my noob question, but how can I add a shadow area/color between the upper and lower lines in a seaborn chart? The primary code I've working on is the following: plt.figure(figsize=(18,10)) sns.set(style="darkgrid") palette = sns.color_palette("mako_r", 3) sns.lineplot(x="Date", y="Value", hue='Std_Type', style='Value_Type', sizes=(.25, 2.5), palette = palette, data=tbl4) The idea is to get some effect like below (the example from seaborn website): But I could not replicate the effect

What does the background area mean in seaborn regression plot?

寵の児 提交于 2020-07-21 03:47:25
问题 What does the background in blue mean or determine in the regression plot when using seaborn? What determines its width at both ends? 回答1: According to seaborn documentation, that area rappresents the confidence interval . You can set it through the ci parameter: Size of the confidence interval for the regression estimate. This will be drawn using translucent bands around the regression line. The confidence interval is estimated using a bootstrap; for large datasets, it may be advisable to

What does the background area mean in seaborn regression plot?

本小妞迷上赌 提交于 2020-07-21 03:47:13
问题 What does the background in blue mean or determine in the regression plot when using seaborn? What determines its width at both ends? 回答1: According to seaborn documentation, that area rappresents the confidence interval . You can set it through the ci parameter: Size of the confidence interval for the regression estimate. This will be drawn using translucent bands around the regression line. The confidence interval is estimated using a bootstrap; for large datasets, it may be advisable to

What does the background area mean in seaborn regression plot?

十年热恋 提交于 2020-07-21 03:46:25
问题 What does the background in blue mean or determine in the regression plot when using seaborn? What determines its width at both ends? 回答1: According to seaborn documentation, that area rappresents the confidence interval . You can set it through the ci parameter: Size of the confidence interval for the regression estimate. This will be drawn using translucent bands around the regression line. The confidence interval is estimated using a bootstrap; for large datasets, it may be advisable to

Python: How to plot multiple seaborn heatmaps side-by-side?

喜夏-厌秋 提交于 2020-07-20 18:41:47
问题 I have a Pandas dataframe with 20+ features. I would like to see their correlation matrices. I create the heatmaps with code like the below, with subset1 , subset2 , etc.: import seaborn as sns cmap = sns.diverging_palette( 220 , 10 , as_cmap = True ) sb1 = sns.heatmap( subset1.corr(), cmap = cmap, square=True, cbar_kws={ 'shrink' : .9 }, annot = True, annot_kws = { 'fontsize' : 12 }) I would like to be able to display multiple heatmaps generated by the above code, side-by-side like so:

Python: How to plot multiple seaborn heatmaps side-by-side?

↘锁芯ラ 提交于 2020-07-20 18:39:30
问题 I have a Pandas dataframe with 20+ features. I would like to see their correlation matrices. I create the heatmaps with code like the below, with subset1 , subset2 , etc.: import seaborn as sns cmap = sns.diverging_palette( 220 , 10 , as_cmap = True ) sb1 = sns.heatmap( subset1.corr(), cmap = cmap, square=True, cbar_kws={ 'shrink' : .9 }, annot = True, annot_kws = { 'fontsize' : 12 }) I would like to be able to display multiple heatmaps generated by the above code, side-by-side like so:

How to calculate the common volume/intersection between 2, 2D kde plots in python?

为君一笑 提交于 2020-07-20 04:14:12
问题 I have 2 sets of datapoints: import random import pandas as pd A = pd.DataFrame({'x':[random.uniform(0, 1) for i in range(0,100)], 'y':[random.uniform(0, 1) for i in range(0,100)]}) B = pd.DataFrame({'x':[random.uniform(0, 1) for i in range(0,100)], 'y':[random.uniform(0, 1) for i in range(0,100)]}) For each one of these dataset I can produce the jointplot like this: import seaborn as sns sns.jointplot(x=A["x"], y=A["y"], kind='kde') sns.jointplot(x=B["x"], y=B["y"], kind='kde') Is there a

Labels for clustermap in seaborn?

自闭症网瘾萝莉.ら 提交于 2020-07-16 16:06:07
问题 I have several questions about labeling for clustermap in seaborn . First is it possible to extract the the distance values for the hierarchical clustering, and plot the value on the tree structure visualization (maybe only the first three levels). Here is my example code for creating a clustermap plot: import pandas as pd import numpy as np import seaborn as sns get_ipython().magic(u'matplotlib inline') m = np.random.rand(50, 50) df = pd.DataFrame(m, columns=range(4123, 4173), index=range

How to change the plot order of the categorical x-axis?

旧街凉风 提交于 2020-07-15 09:44:12
问题 I got a dataframe which looks like below: df: Time of Day Season value Day Shoulder 30.581606 Day Summer 25.865560 Day Winter 42.644530 Evening Shoulder 39.954759 Evening Summer 32.053458 Evening Winter 53.678297 Morning Shoulder 32.171245 Morning Summer 25.070815 Morning Winter 42.876667 Night Shoulder 22.082042 Night Summer 17.510290 Night Winter 33.262356 I am plotting the values in line plot using seaborn using following code: g = sns.lineplot(x='Time of Day',y='value',data=df,hue='Season