필터 지우기
필터 지우기

Simple question regarding plot

조회 수: 2 (최근 30일)
Sameer
Sameer 2014년 9월 9일
답변: Ahmed 2014년 9월 9일
Hello all
I have 2 set of data let say Given_data and Obtained_data now I want to draw first Given_data on x axis as red points and Obtained_data on y axis as blue points.
How that can be done?
Please Guide
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2014년 9월 9일
Sameer - what do you mean by drawing the Given_data on x axis as red points and Obtained_data on y axis as blue points? If you want to plot both on the same set of axes in different colours, just do
figure;
plot(Given_data,'b.'); % plot in blue points
hold on;
plot(Obtained_data,'r.'); % plot in red points
The above will plot both sets of data points on the same axes in blue and red as required.

댓글을 달려면 로그인하십시오.

채택된 답변

Ahmed
Ahmed 2014년 9월 9일
Given_data = rand(10,1);
Obtained_data = rand(10,1);
plot(zeros(size(Given_data)),Given_data,'r+');
hold on
xlabel('Given_data');
plot(Obtained_data,zeros(size(Obtained_data)),'b+');
hold off
ylabel('Obtained_data');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by