필터 지우기
필터 지우기

Issue Linking Plot Data in R2015a

조회 수: 4 (최근 30일)
Charles McPherson
Charles McPherson 2016년 2월 10일
Hi, I'm having trouble linking plot data in MATLAB R2015a. It's better to show than describe:
f1 = figure;
plot(dataSet1(2,:),dataSet1(1,:),'o');
linkdata on;
When I execute 'linkdata on', I get the 'graphics have no data sources, cannot link plot'. I have also tried having 'linkdata on' first. That doesn't work either. What does work, curiously enough is explicitly defining the XDataSource and YDataSource for each line in the plot. Ex:
hpl = plot(dataSet1(2,:),dataSet1(1,:),'o');
set(hpl,'XDataSource','dataSet1(2,:)');
set(hpl,'YDataSource','dataSet1(1,:)');
linkdata on;
I'd rather avoid that if I can, since that would lead to far more lines of code than should be necessary. My questions therefore are,
  1. Is there a way to get the first way to work (i.e. not explicitly calling out the sources after plotting)?
  2. If not, why does the first way not work, but the second one work?
Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by