Several usages of plot drawing using Matlab

Source: Internet
Author: User

1. Set the width of the drawing line    

Set (Haxis, ' linewidth ', 1.0); ----This is the SET function, ' LineWidth ' is the axis line width property, whose value defaults to 0.5, which can be changed to 1.0.

2, adjust the lower limit of the axis
Set (Haxis, ' Xlim ', [2 20]); Set (Haxis, ' Ylim ', [2]),---Adjust the upper and lower bounds of the axis. Z-axis, that same set (Haxis, ' Zlim ', [Zmin, percent Zmax])
3. Adjust the callout number on the axis
Set (Haxis, ' XTick ', 2:1:20); Set (Haxis, ' Ytick ', 2:1:20);----is to adjust the numbers on the axis, 2:1:20 means starting from 2, marking every 1, until 20. Note that here the 2, 20 best and the above corresponding Xlim, ylim the maximum minimum value of the same.

4. The Linetype and color properties provided in MATLAB:

such as: Plot (x1,y1, ' R '), indicate, draw a graphic with a solid red line

Linear

Description

Tag character

Description

Color

Description

-

Solid Line (default)

+

Plus character

R

Red

--

Double Dash

O

Hollow Circle

G

Green

:

Dashed

*

Asterisk

B

Blue

:.

Dot Dash

.

Solid Circle

C

Cyan Green

X

Fork Symbol

M

Magenta

S

Square

Y

Yellow

D

Rhombic

K

Black

^

Upper Triangle

W

White

V

Lower Triangle

>

Right triangle

<

Left Triangle

P

Pentagram

H

Hexagon

5, graphics title, axis labeling, graphical description of the settings

Chart name callout available: title (' xx diagram ')
Axis ([0,22,0,3]),---Display range: X-axis from 0-22, y-axis shown from 0-3.
Xlabel (' Voltage (v) '), Ylabel (' current (a) ') indicates the voltage (v) under the X-axis, and "current (a)" next to the y-axis.

Legend (' A curve ', ' B curve ', ' C curve ') is used to illustrate the description of the curve in the diagram, and the sequence is the same as plot (x1,y1,x2,y2,x3,y3) curves 1, 2, 3.

Using the MATLAB plot to draw several uses (turn)

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.