The Open source Python libraries available are:

**NumPy** adds vectors, matrices, and many high-level mathematical functions
**Scipy** adds mathematical classes and functions useful to scientists
**MatPlotLib** adds an object-oriented API for plotting
**PyLab** combines the other libraries to provide a MATLAB-like interface

**Pylab commands:**

1. pylab.figure(1) :-> gives the figure name

2. pylab.plot() :-> produces the plot

- The first two arguments to pylab.plot must be sequences of the same length.
- First argument gives x-coordinates.
- Second argument gives y-coordinates.

3. pylab.show() :-> displays the plot on output screen

Example :

Note : pylab.figure() should contain number or variable as argument. When tried to give string as argument, it gave below error:

NameError Traceback (most recent call last)

C:\Users\ananth\Documents\6.00.2x Files\plot.py in <module>()

1 import pylab

—-> 2 pylab.figure(sample)

3 pylab.plot([1,3,5,7],[2,4,6,8])

4 pylab.show()

NameError: name ‘sample’ is not defined

### Like this:

Like Loading...

*Related*