如果需要绘制从(1,3)到(8,10)的线,则必须将两个数组[1,8]和[3,10]传递给plot函数。 例如: 在图中从位置(1、3)到位置(8、10)画一条线: importmatplotlib.pyplotaspltimport numpyasnpxpoints = np.array([1,8])ypoints = np.array([3,10])plt.plot(xpoints, ypoints)plt.show() Result: x...
Re: Python 3.5 & matplotlib - won't plot Thu Mar 29, 2018 7:51 pm HI Thanks for the reply. >>> import matplotlib >>> matplotlib.matplotlib_fname() '/usr/local/lib/python3.5/dist-packages/matplotlib-2.2.0+617.g216441741-py3.5-linux-armv7l.egg/matplotlib/mpl-data/matplotlibrc' When...
To update the plot on every iteration during the loop, we can use matplotlib. We constantly update the variables to be plotted by iterating in a loop and then plotting the changed values in Matplotlib to plot data in real-time or make an animation. We use a variety of approaches to visu...