python绘制图形
In many cases, we need to compare the data of two different sources visually and then plotting in the same graph will help us out. But when we need to study differently then we must plot them on different graphs.
在许多情况下,我们需要在视觉上比较两个不同来源的数据,然后在同一张图中绘制将对我们有所帮助。 但是,当我们需要进行不同的研究时,我们必须将它们绘制在不同的图上。
So here is the code:
所以这是代码:
import pylab as pl
#PLOTTING IN SAPERATE GRAPH
pl.figure(1)
pl.plot([1,2,3], [1,2,3,])
#PLOTTING IN SAPERATE GRAPH
pl.figure(2)
pl.plot([1,3,2,4], [4,5,6,7])
pl.figure(3)
#PLOTTING IN SAME GRAPH
pl.plot([1,2,3,4,5,6,7,8], [5,6,5,4,6,4,5,7])
#PLOTTING IN SAME GRAPH
pl.plot([1,2,3,4,5,6,7,8], [5,6,7,9,9,5,7,6])
Output:
输出:
翻译自: https://www.includehelp.com/python/plotting-in-same-and-different-graph.aspx
python绘制图形