plot~ of MATLAB various colors and linear

Source: Internet
Author: User

Plot is a common command in MATLAB ~

You can use Help plot to query related commands about plot plots.

Help plot

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/BB/wKiom1ZbCa2SAY0KAABsO3QLY8M595.png "title=" Helpplot.png "alt=" Wkiom1zbca2say0kaabso3qly8m595.png "/>

We recommend that you draw a test for yourself ~

And these commands can be used overlay. That

Plot (x, y, ' Bo ');

You can draw a blue circle shape graph line.


In addition to the MATLAB comes with these 8 colors, if you need a richer color draw line, you can use the ' color ' parameter to customize the line color, you can refer to this blog garden article.

Http://www.cnblogs.com/takeaction/p/3789871.html


So the question is, if you use the ' color ' parameter to make RGB color, you can only get the solid line, if I want to use custom color to achieve different linetype, that is, RGB and linetype combination, how to achieve it?


At first I had an analogy with the previous approach, in

Plot (x, y, ' Coloro ', [0 1 0]);

Or

Plot (x, y, ' color ', [0 1 0], ' o ');

are not able to achieve the purpose

I later found that I was able to achieve my purpose before I put the Linetype parameter in ' color ', i.e.

Plot (x, y, ' o ', ' color ', [0 1 0]);

This will find that your MATLAB can achieve a variety of colors!


Below ~ Draw a disc on the opposite side.

QPSKCONSTELLATION = [-1+1I 1+1I; -1-1I 1-1I]/SQRT (2); Qpsk = reshape ( Qpskconstellation,1,[]);  num  = 40;outter = 60; for nn = 1:o utter  qpsk = qpsk *  (outter-1)/outter;  c = rand (Num,3); The        % randomly generates 12 colors. RGB Random.      for idx = 1:Num          theta = pi/n/num*idx;         rou = [ Cos (theta)  sin (theta); sin (theta)  -cos (theta)];     realpart =  Real (QPSK);      imagpart = imag (QPSK);      reim  = rou * [realpart;imagpart];     realpart2 = real (QPSK *0.3);      imagpart2 = imag (qpsk*0.3);      reim2 = rou * [realpart2;imagpart2];       plot (Reim (1,:), Reim (2,:), ' o ', ' Color ', C (idx,:));     hold on;      plot (reim2 (1,:), reim2 (2,:), '. ', ' Color ', C (idx,:));     hold on;      pause (0.005);      end end

Copy it and run it. hehe ~

plot~ of MATLAB various colors and linear

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.