Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Python Programming/matplotlib

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

pyFormex Natural Language Toolkit matplotlib is a Python library that allows Python to be used like Matlab, visualizing data on the fly. It is able to create plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc. It can be used from normal Python and also from iPython. Examples: Plot a data series that represents the square function: from matplotlib import pyplot as plt data = [x * x for x in range(20)] plt.plot(data) plt.show() Plot a data series that represents the square function but in reverse order, by providing not only the series of the y-axis values but also the series of x-axis values: from matplotlib import pyplot as plt datax = list(range(20)) datax.reverse() datay = [x * x for x in range(20)] plt.plot(datax, datay) plt.show() Plot the square function, setting the limits for the y-axis: from matplotlib import pyplot as plt data = [x * x for x in range(20)] plt.ylim(-500, 500) # Set limits of y-axis plt.plot(data) plt.show() Links matplotlib, matplotlib.org Pyplot tutorial, matplotlib.org Plotting, wiki.python.org pyFormex Natural Language Toolkit