[MATLAB] PLOT

Source: Internet
Author: User

Plot
2-D Line Plot
Syntax
Plot (y)
Plot (x1, Y1,..., xn, yn)
Plot (x1, Y1, linespec,..., xn, YN, linespec)
Plot (..., 'propertyname', propertyvalue ,...)
Plot (axes_handle ,...)
H = plot (...)

1. Set the coordinate font (A)

Set (GCA, 'fontsize', 12 );

2. Set the x-axis markup text (B)

Xlabel ('frequency (HZ) ', 'fontsize', 14, 'fontname', 'times new Roman ');

Ylabel ('plasma (db) ', 'fontsize', 14, 'fontname', 'times new Roman ');

3. Set the display range of drawing coordinates

Axis ([400 3000-20 70]); % of which 400 3000 is the minimum and maximum values of the X axis;-20 and 70 are the minimum and maximum values of week Y.

4. Set the drawing size.

Set (GCF, 'position', [200 200 350 250]); % Where (200,200) is the coordinate in the lower left corner of the drawing;

% (350,250) is the coordinate in the upper-right corner of the drawing.

5. Mark (C)

Text (0.4, 55,'m = 400,300 ', 'fontsize', 14); % add annotation M = 0.4 at location

6. Set the title (D)

Title ('800hz, sqrt0, 100 ');

7. Set the curve width.

Set (findobj (get (GCA, 'Children '), 'linewidth', 0.5), 'linewidth', 1); % set line width

8. Store drawings

Saveas (GCF, 'test. emf', 'emf'); % the current image is stored as test. EMF.

9. Do not display the drawing

Set (GCF, 'visable', 'off'); % the image is not displayed.

10. annotate different curves in the same drawing

Legend ('m = 100','m = 100 ');

 

E.g.

I,

t1 = (0:11)/11*pi;y1 = sin(t1) .* sin(9*t1);t2 = (0:100) / 100 *pi;y2 = sin(t2) .* sin(9*t2);subplot(2,3,1)plot(t1,y1,'r.')subplot(2,3,4)plot(t2,y2,'r.')subplot(2,3,2)plot(t1,y1,'r')subplot(2,3,5)plot(t2,y2,'r')subplot(2,3,3)plot(t1,y1,t1,y1,'r.')subplot(2,3,6)plot(t1,y1,'g',t1,y1,'r.')

II,

plot(x,y,'r',x,y, 'ks','MarkerSize',7)

III,

A = load('result.txt');% for i = 0:0%     start = i*4 +1%     en = (i+1) *4%     x = A(start:en, 1)%     y = A(start:en, 2)% endfigurehold onx = A(1:4,1);y = A(1:4,2);plot(x,y, '-ks','MarkerSize',7, 'LineWidth', 1)x = A(5:8,1);y = A(5:8,2);plot(x,y, '-m+','MarkerSize',7, 'LineWidth', 1)x = A(9:12,1);y = A(9:12,2);plot(x,y, '-bo','MarkerSize',7, 'LineWidth', 1)x = A(13:16,1);y = A(13:16,2);plot(x,y, '-yx','MarkerSize',7, 'LineWidth', 1)x = A(17:20,1);y = A(17:20,2);plot(x,y, '-rd','MarkerSize',7, 'LineWidth', 1)x = A(21:24,1);y = A(21:24,2);plot(x,y, '-c*','MarkerSize',7, 'LineWidth', 1)axis([0,500,0.66,0.74])grid ontitle('Warm Prediction')xlabel('Given'),ylabel('NMAE')legend('A','B','C','D','E','F')set(findobj(get(gca,'Children'),'LineWidth',1),'LineWidth',2);

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.