Python matplotlib draw three function images

Source: Internet
Author: User


Installed is anaconda, which contains NumPy, scipy, matplotlib and other scientific computing packages


Https://www.continuum.io/downloads


Open python in Anaconda in terminal


/home/qi/anaconda/bin/python

>>> from matplotlib import pyplot as pl>>> import numpy as np>>> from scipy import interpolate&     gt;>> x = Np.linspace ( -10, 5, +) >>> y = -2*x**3 + 5*x**2 + 9>>> pl.figure (figsize = (8, 4)) <matplotlib.figure.figure object at 0xb14f10ac>>>> pl.plot (x, y, color= "blue", LineWidth = 1.5) [< Matplotlib.lines.Line2D object at 0xb0c6348c>]>>> pl.show ()

Pl.figure Setting the plot area size

Pl.plot start drawing, and set line color, and line width

Pl.show Display Image


Display image

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/85/9D/wKioL1eqfB_xuUeAAABR1jG11MU044.png-wh_500x0-wm_3 -wmp_4-s_305764135.png "title=" Figure_1.png "alt=" Wkiol1eqfb_xuueaaabr1jg11mu044.png-wh_50 "/>


Reference:

http://zhan.renren.com/pythonlover?gid=3602888498028996903

This article is from the "R and Python apps" blog, so be sure to keep this source http://matrix6ro.blog.51cto.com/1746429/1836377

Python matplotlib draw three function images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.