Python program for plotting in same and different graph

In this fragment, we are going to make one stride further in pylab library to investigate how to plot two information in the same chart and just as in various diagrams?

By and large, we have to analyze the information of two distinct sources outwardly and afterwards plotting in a similar diagram will enable us to out. Be that as it may, when we have to think about diversely then we should plot them on various charts.

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:

Python program for plotting in same and different graph

Leave a Comment

error: Alert: Content is protected!!