seaborn

Normed histogram y-axis larger than 1

偶尔善良 提交于 2020-07-28 04:54:08
问题 Sometimes when I create a histogram, using say seaborn's displot function, with norm_hist = True, the y-axis is less than 1 as expected for a PDF. Other times it takes on values greater than one. For example if I run sns.set(); x = np.random.randn(10000) ax = sns.distplot(x) Then the y-axis on the histogram goes from 0.0 to 0.4 as expected, but if the data is not normal the y-axis can be as large as 30 even if norm_hist = True. What am I missing about the normalization arguments for histogram

Violin Plot troubles in Python on log scale

眉间皱痕 提交于 2020-07-28 04:48:50
问题 My violin plots are showing weird formats when using a log scale on my plots. I've tried using matplotlib and seaborn and I get very similar results. import matplotlib.pyplot as plt import seaborn as sns data = [[1e-05, 0.00102, 0.00498, 0.09154, 0.02009, 1e-05, 0.06649, 0.42253, 0.02062, 0.10812, 0.07128, 0.03903, 0.00506, 0.13391, 0.08668, 0.04127, 0.00927, 0.00118, 0.063, 0.18392, 0.05948, 0.07774, 0.14018, 0.0133, 0.00339, 0.00271, 0.05233, 0.00054, 0.0593, 1e-05, 0.00076, 0.03409, 0

Can I generate a boxplot without a dataset and only having the relevant values (median, quartiles, etc) in matplotlib?

◇◆丶佛笑我妖孽 提交于 2020-07-27 23:30:00
问题 I have calculated medians, lower/upper quartiles, minimum and maximum values as part of a separate application of mine and written those values to a file and I would like to construct boxplots using these specific values. Is there a way using matplotlib (or seaborn) to manually specify each of these values instead of providing an array of data (I don't need outliers)? I've tried looking through the documentation and I haven't found anything particularly relevant, but I may have overlooked

Can I generate a boxplot without a dataset and only having the relevant values (median, quartiles, etc) in matplotlib?

对着背影说爱祢 提交于 2020-07-27 23:23:04
问题 I have calculated medians, lower/upper quartiles, minimum and maximum values as part of a separate application of mine and written those values to a file and I would like to construct boxplots using these specific values. Is there a way using matplotlib (or seaborn) to manually specify each of these values instead of providing an array of data (I don't need outliers)? I've tried looking through the documentation and I haven't found anything particularly relevant, but I may have overlooked

Can I generate a boxplot without a dataset and only having the relevant values (median, quartiles, etc) in matplotlib?

梦想与她 提交于 2020-07-27 23:23:00
问题 I have calculated medians, lower/upper quartiles, minimum and maximum values as part of a separate application of mine and written those values to a file and I would like to construct boxplots using these specific values. Is there a way using matplotlib (or seaborn) to manually specify each of these values instead of providing an array of data (I don't need outliers)? I've tried looking through the documentation and I haven't found anything particularly relevant, but I may have overlooked

Can I generate a boxplot without a dataset and only having the relevant values (median, quartiles, etc) in matplotlib?

北战南征 提交于 2020-07-27 23:21:06
问题 I have calculated medians, lower/upper quartiles, minimum and maximum values as part of a separate application of mine and written those values to a file and I would like to construct boxplots using these specific values. Is there a way using matplotlib (or seaborn) to manually specify each of these values instead of providing an array of data (I don't need outliers)? I've tried looking through the documentation and I haven't found anything particularly relevant, but I may have overlooked

13分钟,教你python可视化分析20W数据,找到妹子最爱的内衣

て烟熏妆下的殇ゞ 提交于 2020-07-25 19:55:22
最近正值“618活动”,阿里、拼多多、京东等都在发力,商品的价格也下降了不少。我打开某宝首页,顿时想对某些商品的评论进行一次爬取分析。 一提到爬取,我们肯定先想到python,那可真的是利器,不过我提醒一句,不允许爬的千万不要碰。python虽然爬取简单,但是做可视化分析需要费不少力气,虽然有 Matplotlib 和 Seaborn 两个包就足够了。 如果只调用基本的函数可能做出来的图会比较简陋,要达到好看的效果还是需要很多的精力和代码的,不适用于零基础小白。 所以我想到了当下最火的BI分析工具,有了数据,直接拖拽就能得到可视化分析,完全就是零代码,python+BI在手,打遍无敌手。原理也很简单,数据获取是通过Python进行的,然后得到Excel表,BI可以直接连接数据源,负责最后应用层的数据处理、加工和可视化。 那分析什么呢?想来想去,我选择了女性的内衣。 不要想歪,不要怀疑,这就是一个数据可视化项目,纯属娱乐,大家看看就行,重要是我分析的过程,如果能学到东西我就更开心了,我只用了13分钟。 话不多说,进入主题。 一、数据获取 数据来自python爬虫获取,淘宝约50个文胸商品的20W条评论数据,原始数据是txt格式,为了方便处理,这边转为Dataframe~ 由于篇幅的限制,这里只放部分代码,感兴趣的可以到文末。 二、分析目的 这里先给大家做一个科普,对于很多只知道A/B

How to annotate text on horizontal Seaborn barplot?

☆樱花仙子☆ 提交于 2020-07-23 04:23:49
问题 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 ...

How to annotate text on horizontal Seaborn barplot?

邮差的信 提交于 2020-07-23 04:23:06
问题 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 ...

How to annotate text on horizontal Seaborn barplot?

做~自己de王妃 提交于 2020-07-23 04:22:29
问题 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 ...