matplotlib

Error bars in matplotlib display over other curves

大城市里の小女人 提交于 2021-02-11 06:52:06
问题 I have a plot in which some data is represented by a scatter plot with error bars and I want to fit a curve to it. However, no matter where in the code I plot the curve, the error bars float on top of it. I want the fitted curves to display in front of the error bars because otherwise I can't see it. Here is a simple example of the issue: import numpy as np import matplotlib.pyplot as plt import matplotlib x = np.arange(1,10) r = np.random.random(x.size) fig1, ax = plt.subplots() ln1 = ax

matplotlib animation save is not obeying blit=True but it seems to work just fine in plt.show()

末鹿安然 提交于 2021-02-11 06:16:10
问题 I'm quite new to Python and am trying to animate text using matplotlib. used several online examples to arrive at the following code: import matplotlib.pyplot as plt import matplotlib.animation as animation fig, ax = plt.subplots() plt.xlabel('Distance') plt.ylabel('Height') plt.title('Object Trajectory \n') plt.legend(loc="upper right", markerscale=4, fontsize=10) plt.grid() text=ax.text(3,1,'Moving Text', ha="left", va="bottom",clip_on=True,rotation=90,fontsize=15) text2=ax.text(0,1,'Moving

Matplotlib FuncAnimation, error when blit = true.

喜夏-厌秋 提交于 2021-02-11 04:32:56
问题 I am trying to make an animation of an expanding circle using FuncAnimation and circle.set_radius(). However, the animation only works when blit = False. The code is as follow: import numpy as np import matplotlib.pyplot as plt from matplotlib import animation fig, ax = plt.subplots() plt.grid(True) plt.axis([-0.6, 0.6, -0.6, 0.6]) circle1= plt.Circle([0,0],0.01,color="0.",fill=False, clip_on = True) ax.add_patch(circle1) dt = 1.0/20 vel = 0.1 def init(): circle1.set_radius(0.01) def animate

matplotlib.pyplot functions creating new figures instead of applyting to the current one

我是研究僧i 提交于 2021-02-11 03:43:40
问题 I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part. When I do this, import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to

matplotlib.pyplot functions creating new figures instead of applyting to the current one

╄→尐↘猪︶ㄣ 提交于 2021-02-11 03:43:06
问题 I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part. When I do this, import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to

matplotlib.pyplot functions creating new figures instead of applyting to the current one

一笑奈何 提交于 2021-02-11 03:42:26
问题 I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part. When I do this, import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to

matplotlib.pyplot functions creating new figures instead of applyting to the current one

余生长醉 提交于 2021-02-11 03:41:26
问题 I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part. When I do this, import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to

matplotlib.pyplot functions creating new figures instead of applyting to the current one

て烟熏妆下的殇ゞ 提交于 2021-02-11 03:40:16
问题 I'm starting to learn matplotlib, following the pyplot tutorial, but something weird—I think—is happening in the very first part. When I do this, import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show() plt.plot([1, 2, 3, 4]) creates the figure, but plt.ylabel('some numbers') creates another figure with the label but with no plot. Nothing about this is mentioned in the tutorial, and I have been reading about the plt functions to see if this is supposed to

Matplotlibrc needs to be updated?

微笑、不失礼 提交于 2021-02-10 22:24:31
问题 So I wiped Python 3.6 some weeks ago and seem to have incorrectly reinstalled matplotlib etc because I've been getting a bunch of errors for different things. I'm trying to run a script that displays a number of images side by side using subplot. Tried it from the command line, worked fine. But when I write it all up in a script and try to run it (I have about 24 images) I get the following error: You probably need to get an updated matplotlibrc file from http://github.com/matplotlib

Matplotlibrc needs to be updated?

不打扰是莪最后的温柔 提交于 2021-02-10 22:24:05
问题 So I wiped Python 3.6 some weeks ago and seem to have incorrectly reinstalled matplotlib etc because I've been getting a bunch of errors for different things. I'm trying to run a script that displays a number of images side by side using subplot. Tried it from the command line, worked fine. But when I write it all up in a script and try to run it (I have about 24 images) I get the following error: You probably need to get an updated matplotlibrc file from http://github.com/matplotlib