How to choose the type and color of MATLAB drawing line?

Source: Internet
Author: User
Tags dashed line

How to choose the type and color of the MATLAB drawing line? Matlab is a very powerful mapping function, so it is widely used in scientific experiments and social research. How do we choose the type of line when we draw a graphic? For example, we need dotted lines, star dots. Or how do you set the color of the line? Here's how to do this, for example, with a simple drawing operation.

1, draw 0 to the 2*pi range of sine cosine function, the default figure is solid line, the first color is blue, the second red ...

2. Set Line style:

You can set a specific line style when writing drawing code, for example, a dashed line: plot (x,y1, '--')

3. Draw Star Line: Plot (x,y1, ' P '), similarly, ' * ', * line, ' < ', triangle symbol line, etc.

4, set Line color: Plot (x,y1, ' R '), similarly, in the second picture gives a variety of colors and line patterns of symbols.

5, in addition, we can set the line style and color in a single command. Plot (x,y1, '--*r ').

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.