Issue Linking Plot Data in R2015a
조회 수: 4 (최근 30일)
이전 댓글 표시
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,
- Is there a way to get the first way to work (i.e. not explicitly calling out the sources after plotting)?
- If not, why does the first way not work, but the second one work?
Thanks!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!