subplot

Plot all pandas dataframe columns separately

柔情痞子 提交于 2020-01-23 17:32:06
问题 I have a pandas dataframe who just has numeric columns, and I am trying to create a separate histogram for all the features ind group people value value_50 1 1 5 100 1 1 2 2 90 1 2 1 10 80 1 2 2 20 40 0 3 1 7 10 0 3 2 23 30 0 but in my real life data there are 50+ columns, how can I create a separate plot for all of them I have tried df.plot.hist( subplots = True, grid = True) It gave me an overlapping unclear plot. how can I arrange them using pandas subplots = True. Below example can help

Matplotlib: subplot

只愿长相守 提交于 2020-01-23 17:04:12
问题 I have several time series signals (8x8) that I would like to plot using subplot. My data are stored in a matrix called H(x, y, N) where N is the number of points in each signal. I would like to display the 64 signals using subplots. fig = figure(figsize=(12,8)) time = np.arange(0, Nt, 1) for x in range(8): for y in range(8): subplot(8,y+1,x+1) plot(time,H[x,y,:]) What I get is 8 signals in the first row, 4 in the second one, then 2, 2, 1, 1, 1 and 1. 回答1: That's not how subplot indexing

Matplotlib: subplot

馋奶兔 提交于 2020-01-23 17:03:59
问题 I have several time series signals (8x8) that I would like to plot using subplot. My data are stored in a matrix called H(x, y, N) where N is the number of points in each signal. I would like to display the 64 signals using subplots. fig = figure(figsize=(12,8)) time = np.arange(0, Nt, 1) for x in range(8): for y in range(8): subplot(8,y+1,x+1) plot(time,H[x,y,:]) What I get is 8 signals in the first row, 4 in the second one, then 2, 2, 1, 1, 1 and 1. 回答1: That's not how subplot indexing

Matplotlib: subplot

冷暖自知 提交于 2020-01-23 17:03:05
问题 I have several time series signals (8x8) that I would like to plot using subplot. My data are stored in a matrix called H(x, y, N) where N is the number of points in each signal. I would like to display the 64 signals using subplots. fig = figure(figsize=(12,8)) time = np.arange(0, Nt, 1) for x in range(8): for y in range(8): subplot(8,y+1,x+1) plot(time,H[x,y,:]) What I get is 8 signals in the first row, 4 in the second one, then 2, 2, 1, 1, 1 and 1. 回答1: That's not how subplot indexing

Matplotlib: subplot

て烟熏妆下的殇ゞ 提交于 2020-01-23 17:03:04
问题 I have several time series signals (8x8) that I would like to plot using subplot. My data are stored in a matrix called H(x, y, N) where N is the number of points in each signal. I would like to display the 64 signals using subplots. fig = figure(figsize=(12,8)) time = np.arange(0, Nt, 1) for x in range(8): for y in range(8): subplot(8,y+1,x+1) plot(time,H[x,y,:]) What I get is 8 signals in the first row, 4 in the second one, then 2, 2, 1, 1, 1 and 1. 回答1: That's not how subplot indexing

Getting text to display in front of subplot images

纵饮孤独 提交于 2020-01-21 09:41:47
问题 Ive got a lot of images of galaxies through different filters. each line of subplots represents a new object with a unique 'ID'. Im plotting all of these images using the subplot function but am having trouble adding the ID name. Ideally the ID would stretch in front of several subplots but at the moment it is placed behind (see picture). Does anyone know of a way to fix this? plt.close('all') ID=np.array([]) cata=csv.reader(open('final_final_list.csv',"rU")) for x in cata: ID=np.append(ID,x

matplotlib - No xlabel and xticks for twinx axes in subploted figures

扶醉桌前 提交于 2020-01-20 07:58:46
问题 What I want to do is a 2x2 diagrams in a subplot. Then, for each figure, I am going to use two y-axes. Therefore, I used twinx() method for each diagram. The problem as you see in the figure I shared is that it does not show xlabel and xticks for first row. For the second row, everything is fine. I have specified the problem in red font in the figure ("No xlabel and xticks!!!"). Each diagram has its own x-axis and y-axis and there is no sharing in that. I have tweaked this code a lot and

matplotlib - No xlabel and xticks for twinx axes in subploted figures

杀马特。学长 韩版系。学妹 提交于 2020-01-20 07:56:27
问题 What I want to do is a 2x2 diagrams in a subplot. Then, for each figure, I am going to use two y-axes. Therefore, I used twinx() method for each diagram. The problem as you see in the figure I shared is that it does not show xlabel and xticks for first row. For the second row, everything is fine. I have specified the problem in red font in the figure ("No xlabel and xticks!!!"). Each diagram has its own x-axis and y-axis and there is no sharing in that. I have tweaked this code a lot and

How to draw animated legend for subplots?

a 夏天 提交于 2020-01-13 05:00:30
问题 I would like to draw animated subplots with ArtistAnimation. Unfortunately, I cannot figure out how to have an animated legend. I tried out different methods I found on StackOverflow. If I manage to get a legend it is not animated, but just the legends of all animation steps together. My code looks like this: import numpy as np import pylab as pl import matplotlib.animation as anim fig, (ax1, ax2, ax3) = pl.subplots(1,3,figsize=(11,4)) ims = [] im1 = ['im11','im12','im13'] im2 = ['im21','im22

Updating bar and plot subplots over loop iterations

喜你入骨 提交于 2020-01-11 07:11:23
问题 I wrote the following snippet and I am trying to make it update the plots. What I get instead is an overlapping of new plots on the old ones. I researched a bit and found I needed relim() and autoscale_view(True,True,True) on the current axis. I still cannot get the desired behaviour. Is there a way to force pyplot to delete/remove the old drawing before calling plt.draw()? import numpy as np import matplotlib.pyplot as plt import time plt.ion() a = np.arange(10) fig,ax = plt.subplots(2,1)