Meteoinfolab Script Example: Multi-y-axis diagram

Source: Internet
Author: User
Tags sin

Multiple Y-axes are important when comparing data ranges that are relatively large. A Twinx function is provided in Meteoinfolab to generate a new Axes based on the existing coordinate system (Axes), which causes the existing Axes not to draw the right y-axis, and the newly generated Axes draws only the right y-axis. The YAxis function can set the y-axis of a axes, the first parameter is a axes object, you can set the y-axis color and offset (shift), and the 3rd y-axis must be offset to avoid the gland for graphs over 2 y-axes.

Double y-Axis diagram:

Multiple y-axis graphs:

Script Program:

Ax1 =axes () yaxis (ax1, Color='b') T= Arange (0.01, 10.0, 0.01) S1=exp (t) plot (T, S1,'B -', linewidth=2) Xlabel ('Time (s)') Ylabel ('Exp', color='b') Ax2=Twinx (AX1) yaxis (ax2, Color='R') S2= Sin (2*pi*t) plot (T, S2,'R.') Ylabel ('Sin', color='R') Show ()

AX1 = Axes (position=[0.113,0.15,0.7,0.8]) YAxis (ax1, Color='b') line1= Plot ([0, 1, 2], [0, 1, 2],'B -', label="Density") Xlabel ('Distance') Ylabel ('Density', color='b') title ('mutiple Y Axis Sample') Ax2=Twinx (AX1) yaxis (ax2, Color='R') Line2= Plot ([0, 1, 2], [0, 3, 2],'R', label="Temperature") Ylabel ('Temperature', color='R') Ax3=Twinx (AX1) YAxis (AX3, Shift=60, color='g') Line3= Plot ([0, 1, 2], [50, 30, 15],'g', label="Velocity") Ylabel ('Velocity', color='g') Lines=[Line1, Line2, Line3]legend (lines) show ()

Meteoinfolab Script Example: Multi-y-axis diagram

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.