MATLAB plot Function

Source: Internet
Author: User

Coordinate Control
The Calling format of the axis function is:
Axis ([xmin xmax ymin Ymax zmin zmax])
The Axis functions are rich and common formats include:
Axis equal: the vertical and horizontal axes adopt a long scale.
Axis square: generate a square coordinate system (rectangle by default ).
Axis Auto: use the default settings.
Axis off: cancel the axis.
Axis on: displays the axis.
Use the grid command to control the gridlines of coordinates. The grid on/off command controls whether to draw or not grid lines. Grid commands without parameters are switched between the two States.
Add Borders to coordinates and use the box command to control them. The box on/off command controls whether to add or not to the border line. Box commands without parameters are switched between the two States.

 

Xlabel (X axis description)
Ylabel (Y axis description)
Text (X, Y, graphic description)

Set function: for example, if you want X coordinates to be displayed from 1 to 100, the scale is 20; y coordinates to be displayed from 1 to 10, and the scale is 2
Set (GCA, 'xticket', [], 'yticket', []);
 

 

Set curve style
MATLAB provides some plotting options for determining the line type, color, and data point marking of the drawn curve, which can be used in combination. For example, "B-." indicates a blue dash, and "Y: D" indicates a yellow dotted line and marks a data point with a diamond. When the option is omitted, Matlab specifies that the line type is solid, and the color is in sequence based on the curve.
To set a curve style, add the drawing option in the plot function. The call format is as follows:
Plot (x1, Y1, option 1, X2, Y2, option 2 ,..., XN, YN, option n)

The detailed feature characters are described as follows:
Color and Color Symbols
B blue
G green
R red
C cayn cyan
M magenta red
Y yellow
K black
W white
Linear symbols
-Solid line
: Dotted line
-. Dashes
-- Double dashes
Description of data point mark symbols
. Solid point
O hollow circle
X forks
+ Cross
* Mi characters
S Square
D Diamond
V lower triangle
^ Upper triangle
<Left triangle
> Right triangle
P pentagram
H hex hexagonal star
 

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.