matplotlib

How can a plot a 5 grouped bars bar chart in matplotlib?

☆樱花仙子☆ 提交于 2021-01-29 03:03:44
问题 I have the following dataframe: meteo = [["January", 9.2, 13.6, 4.7, 37, 70], ["February",9.9, 14.3, 5.4, 35, 70], ["March", 11.8, 16.1, 7.4, 36, 70], ["April", 13.7, 18.0, 9.4, 40, 69], ["May", 16.9, 21.1, 12.8, 47, 70], ["June", 20.9, 24.9, 16.8, 30, 68], ["July", 23.9, 28.0, 19.8, 21, 67], ["August", 24.4, 28.5, 20.2, 62, 68], ["September", 21.7, 26.0, 17.4, 81, 70], ["October", 17.8, 22.1, 13.5, 91, 73], ["November", 13.0, 17.3, 8.6, 59, 71], ["December", 10.0, 14.3, 5.7, 40, 69]] import

Is it possible to patch an image in matplotlib?

半城伤御伤魂 提交于 2021-01-29 03:02:50
问题 I'm developing and automata in Python with matplotlib, and I would like to design it with a robot-look I picked on the web. I chose a file and I would like to place it in place of the black squares in the image below... I have been looking for a way to do it on the web but I haven't found any answer. FYI, I use the fig = plt.Figure() method and then the fig.add_subplot to create my subplot and I finally generate the black square by creating black patches. 回答1: I don't believe patches are

How can a plot a 5 grouped bars bar chart in matplotlib?

烂漫一生 提交于 2021-01-29 03:02:26
问题 I have the following dataframe: meteo = [["January", 9.2, 13.6, 4.7, 37, 70], ["February",9.9, 14.3, 5.4, 35, 70], ["March", 11.8, 16.1, 7.4, 36, 70], ["April", 13.7, 18.0, 9.4, 40, 69], ["May", 16.9, 21.1, 12.8, 47, 70], ["June", 20.9, 24.9, 16.8, 30, 68], ["July", 23.9, 28.0, 19.8, 21, 67], ["August", 24.4, 28.5, 20.2, 62, 68], ["September", 21.7, 26.0, 17.4, 81, 70], ["October", 17.8, 22.1, 13.5, 91, 73], ["November", 13.0, 17.3, 8.6, 59, 71], ["December", 10.0, 14.3, 5.7, 40, 69]] import

Changing color of single characters in matplotlib plot labels

霸气de小男生 提交于 2021-01-29 02:40:25
问题 Using matplotlib in python 3.4: I would like to be able to set the color of single characters in axis labels. For example, the x-axis labels for a bar plot might be ['100','110','101','111',...], and I would like the first value to be red, and the others black. Is this possible, is there some way I could format the text strings so that they would be read out in this way? Perhaps there is some handle that can be grabbed at set_xticklabels and modified? or, is there some library other than

ValueError: view limit minimum 0.0 is less than 1 and is an invalid Matplotlib date value.

匆匆过客 提交于 2021-01-29 01:35:21
问题 I have a dataframe,df, which i intend to plot a line chart where we cut the window in several subplots, one per group. Then,each group contains each column which is represented by a thick line displayed on its unique subplot while the other columns are displayed discreetly like the picture below so it won't lead to a spaghetti plot. The dimension of the dataframe is (30,26) Index DateTimestamp 0.0 5.0 34.0 ... 22.0 0 2017-08-03 00:00:00 10 0 10 0 1 2017-08-04 00:00:00 20 60 1470 20 3 2017-08

How to zoom in a histogram in seaborn/matplotlib?

血红的双手。 提交于 2021-01-28 23:43:34
问题 I produced a histogram which looks something like this: Code that I used to produce this plot: sns.countplot(table.column_name) As you can notice, the entire histogram gets clustered at the left end due to uneven distribution of data. How do I zoom in at the left end? One way that I tried and it gave me a marginally better result was : plt.xlim(0,25) Is there a better way to do this? 回答1: Looks like the data would be better viewed on a logarithmic scale. On your matplotlib plot axis, ax , use

Visualizing ffmpeg benchmarks

孤人 提交于 2021-01-28 23:38:54
问题 I have generated benchmarks for comparing two approaches taken for scaling down video files (mp4) using ffmpeg tool. The benchmarks are logged in this format : x.mp4 Output_Resolution : 360p Method : A real 0m26.817s user 1m38.058s sys 0m0.504s Method : B, some-parameter-for-B : b1 real 0m26.465s user 1m42.824s sys 0m1.111s Method : B, some-parameter-for-B : b2 real 0m26.236s user 1m42.194s sys 0m0.862s Method : B, some-parameter-for-B : b3 real 0m25.050s user 1m36.492s sys 0m0.680s y.mp4

How to zoom in a histogram in seaborn/matplotlib?

我的梦境 提交于 2021-01-28 23:35:00
问题 I produced a histogram which looks something like this: Code that I used to produce this plot: sns.countplot(table.column_name) As you can notice, the entire histogram gets clustered at the left end due to uneven distribution of data. How do I zoom in at the left end? One way that I tried and it gave me a marginally better result was : plt.xlim(0,25) Is there a better way to do this? 回答1: Looks like the data would be better viewed on a logarithmic scale. On your matplotlib plot axis, ax , use

How to zoom in a histogram in seaborn/matplotlib?

一曲冷凌霜 提交于 2021-01-28 23:20:55
问题 I produced a histogram which looks something like this: Code that I used to produce this plot: sns.countplot(table.column_name) As you can notice, the entire histogram gets clustered at the left end due to uneven distribution of data. How do I zoom in at the left end? One way that I tried and it gave me a marginally better result was : plt.xlim(0,25) Is there a better way to do this? 回答1: Looks like the data would be better viewed on a logarithmic scale. On your matplotlib plot axis, ax , use

Python Matplotlib: how to reduce number of x tick marks for non-numeric tyoe

两盒软妹~` 提交于 2021-01-28 22:10:23
问题 I have this very simple pandas dataframe here and i'm trying to plot the index column (Date, which is formatted as string) against 'Adj Close' Column . Adj Close Date 2010-01-01 1.438994 2010-01-04 1.442398 2010-01-05 1.436596 2010-01-06 1.440403 2010-01-07 1.431803 ... a lot more rows Here's my very simple code: import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot(df['Adj Close'], label='Close Price History') fig.autofmt_xdate() however the graph is unpleasant in the sense that