data-science

How to change the X axis range in seaborn in python?

血红的双手。 提交于 2020-12-02 08:18:49
问题 By default the seaborn displaces the X axis ranges from -5 to 35 in distplots. But I need to display the distplots with the X axis ranges from 1 to 30 with 1 unit. How can I do that? 回答1: For the most flexible control with these kind of plots, create your own axes object then add the seaborn plots to it. Then you can perform the standard matplotlib changes to features like the x-axis, or use any of the normal controls available through the matplotlib API. import matplotlib.pyplot as plt

How to add error bars to a grouped bar plot?

南楼画角 提交于 2020-11-29 10:32:27
问题 I would like to add error bar in my plot that I can show the min max of each plot. Please, anyone can help me. Thanks in advance. The min max is as follow: Delay = (53.46 (min 0, max60) , 36.22 (min 12,max 70), 83 (min 21,max 54), 17 (min 12,max 70)) Latency = (38 (min 2,max 70), 44 (min 12,max 87), 53 (min 9,max 60), 10 (min 11,max 77)) import matplotlib.pyplot as plt import pandas as pd from pandas import DataFrame from matplotlib.dates import date2num import datetime Delay = (53.46, 36.22,