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 ').