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!