Q:

Python program for plotting in same and different graph

belongs to collection: Python miscellaneous programs

0

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.

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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:

plotting in Python

plotting in Python

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python miscellaneous programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Histogram using Pylab in Python... >>
<< Python | Create stack plot using matplotlib.pyplot...