seaborn

Seaborn Lineplot Module Object Has No Attribute 'Lineplot'

巧了我就是萌 提交于 2021-02-08 12:17:20
问题 Using seaborn's documentation code to generate a lineplot returns an AttributeError: 'module' object has no attribute 'lineplot'. I have updated seaborn and reimported the module and tried again, no luck. Did lineplot get retired, or is there something else going on? import seaborn as sns; sns.set() import matplotlib.pyplot as plt fmri = sns.load_dataset("fmri") ax = sns.lineplot(x="timepoint", y="signal", data=fmri) 回答1: If you are using conda, you need to install seaborn with the version

Huge proglem to load Plotly plots in Jupyter Notebook Python

放肆的年华 提交于 2021-02-08 10:37:23
问题 I have a huge problem with Jupyter Notebook. When he builds graphs using the plot packet, to display the next graph I have to reload the dataset, otherwise an error pops up: TypeError: list indices must be integers or slices , not str. When I reopen the project, all the graphs created using Plotly are not visible, just a white background and I have to reload them if I want to see them, and everything after reloading the dataset, that is: 1) I open the project in Jupyte Notebook, all graphs

Huge proglem to load Plotly plots in Jupyter Notebook Python

我与影子孤独终老i 提交于 2021-02-08 10:37:20
问题 I have a huge problem with Jupyter Notebook. When he builds graphs using the plot packet, to display the next graph I have to reload the dataset, otherwise an error pops up: TypeError: list indices must be integers or slices , not str. When I reopen the project, all the graphs created using Plotly are not visible, just a white background and I have to reload them if I want to see them, and everything after reloading the dataset, that is: 1) I open the project in Jupyte Notebook, all graphs

In a single figure, boxplot of all columns split by a “label” column

六眼飞鱼酱① 提交于 2021-02-08 07:35:27
问题 Looking at the boxplot API page, I want something that looks like a combination of this: >>> iris = sns.load_dataset("iris") >>> ax = sns.boxplot(data=iris, orient="h", palette="Set2") Except I want it split by a column that holds a certain label, similarly to what is achieved by the hue argument in an example that follows: ax = sns.boxplot(x="day", y="total_bill", hue="smoker", data=tips, palette="Set3") This example only works when x and y are defined, but for what I want to achieve I want

Making a regression line through a bar char using pandas or seaborn

馋奶兔 提交于 2021-02-07 21:02:55
问题 I am new to Pandas and Seaborn and trying to learn. I am trying to add a trend line and a bar plot on the same graph. I have some data that looks like Year Sample Size 2000 500 2001 3000 2003 10000 2004 20000 2004 23000 I am new to pandas and seaborn and I am attempting to draw a line through the bar plot showing a decreasing or an increasing trend but struggling to do it on the same graph. Till now, I have a bar plot. Below you can find the code. sampleSizes['Sample Size'] -> is the column I

seaborn clustermap: subplots_adjust cancels colour bar relocation

假装没事ソ 提交于 2021-02-07 20:37:21
问题 I'm trying to make a heatmap with the colour bar on the side using seaborn. However, in my real application case, I have long column names that I rotate. This requires the use of plt.subplots_adjust , otherwise the labels do not fit in the image: plt.setp(g.ax_heatmap.get_xticklabels(), rotation=90) plt.subplots_adjust(bottom=0.5) Using the following minimal example, I found out that this last command was cancelling the colour bar relocation: #!/usr/bin/env python3 import seaborn as sns

Seaborn/Matplotlib: how to access line values in FacetGrid?

 ̄綄美尐妖づ 提交于 2021-02-07 14:27:29
问题 I'm trying to shade the area between two lines in a Seaborn FacetGrid. The fill_between method will do this, but I need to access the values of each line in each subplot to pass them in. Here's my code: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns data = [{'Change': 0.0, 'Language': 'Algonquin', 'Type': 'Mother tongue', 'Year': '2011'}, {'Change': 0.0, 'Language': 'Algonquin', 'Type': 'Spoken at home', 'Year': '2011'}, {'Change': -21.32, 'Language': 'Algonquin',

Seaborn/Matplotlib: how to access line values in FacetGrid?

僤鯓⒐⒋嵵緔 提交于 2021-02-07 14:25:33
问题 I'm trying to shade the area between two lines in a Seaborn FacetGrid. The fill_between method will do this, but I need to access the values of each line in each subplot to pass them in. Here's my code: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns data = [{'Change': 0.0, 'Language': 'Algonquin', 'Type': 'Mother tongue', 'Year': '2011'}, {'Change': 0.0, 'Language': 'Algonquin', 'Type': 'Spoken at home', 'Year': '2011'}, {'Change': -21.32, 'Language': 'Algonquin',

How to plot a dashed line on seaborn lineplot?

孤人 提交于 2021-02-07 11:17:47
问题 I'm simply trying to plot a dashed line using seaborn. This is the code I'm using and the output I'm getting import seaborn as sns import numpy as np import matplotlib.pyplot as plt n = 11 x = np.linspace(0,2,n) y = np.sin(2*np.pi*x) sns.lineplot(x,y, linestyle='--') plt.show() What am I doing wrong? Thanks 回答1: It seems that linestyle= argument doesn't work with lineplot() , and the argument dashes= is a bit more complicated than it might seem. A (relatively) simple way of doing it might be

How to plot a dashed line on seaborn lineplot?

妖精的绣舞 提交于 2021-02-07 11:17:02
问题 I'm simply trying to plot a dashed line using seaborn. This is the code I'm using and the output I'm getting import seaborn as sns import numpy as np import matplotlib.pyplot as plt n = 11 x = np.linspace(0,2,n) y = np.sin(2*np.pi*x) sns.lineplot(x,y, linestyle='--') plt.show() What am I doing wrong? Thanks 回答1: It seems that linestyle= argument doesn't work with lineplot() , and the argument dashes= is a bit more complicated than it might seem. A (relatively) simple way of doing it might be