seaborn

Show scatter plot title from column value

﹥>﹥吖頭↗ 提交于 2021-01-04 06:36:54
问题 I'm making automatic scatterplot charting with regression from my dataframe example I want to make correlation between Column2 to Column3 and Column2 to Column4 in separate scatter plot group by Column1. For example, there will be 3 scatter plot of Column2 to Column3 each with the title of A, B, and C For the plotting I'm using pandas scatter plot for example: df.groupby('Column1').plot.scatter(x='Column2',y='Column3') Scatter plot return exactly 3 plot, but I want to know how to add chart

Contour (iso-z) or threshold lines in seaborn heatmap

半城伤御伤魂 提交于 2021-01-02 20:53:41
问题 Is there a way to automatically add contour (iso-z) lines to a heatmap with concrete x and y values? Please consider the official seaborn flights dataset: import seaborn as sns flights = sns.load_dataset("flights") flights = flights.pivot("month", "year", "passengers") sns.heatmap(flights, annot=True, fmt='d') I imagine the step-like lines to look something like shown below (lhs), indicating thresholds (here 200 and 400). They do not need to be interpolated or smoothed in any way, although

Contour (iso-z) or threshold lines in seaborn heatmap

ぃ、小莉子 提交于 2021-01-02 20:52:55
问题 Is there a way to automatically add contour (iso-z) lines to a heatmap with concrete x and y values? Please consider the official seaborn flights dataset: import seaborn as sns flights = sns.load_dataset("flights") flights = flights.pivot("month", "year", "passengers") sns.heatmap(flights, annot=True, fmt='d') I imagine the step-like lines to look something like shown below (lhs), indicating thresholds (here 200 and 400). They do not need to be interpolated or smoothed in any way, although

Contour (iso-z) or threshold lines in seaborn heatmap

烂漫一生 提交于 2021-01-02 20:52:39
问题 Is there a way to automatically add contour (iso-z) lines to a heatmap with concrete x and y values? Please consider the official seaborn flights dataset: import seaborn as sns flights = sns.load_dataset("flights") flights = flights.pivot("month", "year", "passengers") sns.heatmap(flights, annot=True, fmt='d') I imagine the step-like lines to look something like shown below (lhs), indicating thresholds (here 200 and 400). They do not need to be interpolated or smoothed in any way, although

Weighted bins in a distribution hist plot

人走茶凉 提交于 2020-12-31 02:42:52
问题 I'm looking for a way to plot a distribution histogram, with the y-axis representing the total number of items for each bin (and not just the count). Example on the charts below: On the left, there are 55 agencies who sold between 20-30 houses On the right, the agencies having sold between 20-30 houses represent 1100 houses sold It's not as trivial as it looks because one can't simply multiply each bin's count by the bin's value (maybe in the 20-30 bin, there are 54 agencies who sold 21 are 1

Weighted bins in a distribution hist plot

守給你的承諾、 提交于 2020-12-31 02:41:16
问题 I'm looking for a way to plot a distribution histogram, with the y-axis representing the total number of items for each bin (and not just the count). Example on the charts below: On the left, there are 55 agencies who sold between 20-30 houses On the right, the agencies having sold between 20-30 houses represent 1100 houses sold It's not as trivial as it looks because one can't simply multiply each bin's count by the bin's value (maybe in the 20-30 bin, there are 54 agencies who sold 21 are 1

Adding labels to points in seaborn stripplot

坚强是说给别人听的谎言 提交于 2020-12-30 02:27:26
问题 I'm using stripplot on seaborn to show energies of d orbitals in a series of metallic centers. Here is the dataframe: dxy dyz dz2 dxz dx2-y2 Fe -0.25336 -0.24661 -0.22991 -0.07644 -0.16229 Co -0.38294 -0.38050 -0.34952 -0.21271 -0.27173 Ni -0.47550 -0.47504 -0.46817 -0.44385 -0.45632 And using this code I'm quite close to what I want (resulting image below): plt.figure(figsize=(3, 7)) sns.stripplot(x=df.index, y="dxy", data=df, jitter=False, dodge=True, size=44, marker="_", linewidth=2) sns

Adding labels to points in seaborn stripplot

梦想与她 提交于 2020-12-30 02:23:45
问题 I'm using stripplot on seaborn to show energies of d orbitals in a series of metallic centers. Here is the dataframe: dxy dyz dz2 dxz dx2-y2 Fe -0.25336 -0.24661 -0.22991 -0.07644 -0.16229 Co -0.38294 -0.38050 -0.34952 -0.21271 -0.27173 Ni -0.47550 -0.47504 -0.46817 -0.44385 -0.45632 And using this code I'm quite close to what I want (resulting image below): plt.figure(figsize=(3, 7)) sns.stripplot(x=df.index, y="dxy", data=df, jitter=False, dodge=True, size=44, marker="_", linewidth=2) sns

How to plot multiple figures in a row using seaborn

谁说胖子不能爱 提交于 2020-12-30 02:14:50
问题 I have a dataframe df that looks like this: df.head() id feedback nlp_model similarity_score 0xijh4 1 tfidf 0.36 0sdnj7 -1 lda 0.89 kjh458 1 doc2vec 0.78 .... I want to plot similairty_score versus feedback in a boxplot form using seaborn for each of the unique values in the model column: tfidf , lda , doc2vec . My code for this is as follows: fig, ax = plt.subplots(figsize=(10,8)) ax = sns.boxplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='tfidf']) ax = sns.swarmplot(x=

Combining two heat maps in seaborn

故事扮演 提交于 2020-12-29 04:20:09
问题 I have 2 data tables with the dimensions 4x25 . Each table is from a different point in time, but has exactly the same meta data, in essence the same column and row headers. Given the large number of columns, I thought it best to represent this using a heatmap using the seaborn library for Python . However, I need to include both tables in the same plot. I am able to create a single heatmap representing a single data table as so. df = pd.DataFrame(raw_data) ax = sns.heatmap(df) ax.set