Data Visualization (2) draw lines by point

Source: Internet
Author: User
Import matplotlib. pyplot as PLT

X_values = List (range (1,1000 ))
Y_values = [x ** 2 for X in x_values]

# PLT. Scatter (x_values, y_values, S = 40)
# X modify the line color
# PLT. Scatter (x_values, y_values, c = 'red', edgecolor = 'none', S = 40)
# Line color ing display
PLT. Scatter (x_values, y_values, c = y_values, cmap = PLT. cm. Blues, edgecolor = 'none', S = 40)

# Set the chart title and Add labels to the Axis
PLT. Title ("square numbers", fontsize = 24)
PLT. xlabel ("value", fontsize = 14)
PLT. ylabel ("square of value", fontsize = 14)

# Set the size of the scale mark
PLT. tick_params (axis = 'both ', which = 'major', labelsize = 12)

# Set the value range of each coordinate axis
PLT. axis ([,])

PLT. Show ()

Execution result:

 

 

Data Visualization (2) draw lines by point

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.