Filter löschen
Filter löschen

Issue Linking Plot Data in R2015a

4 Ansichten (letzte 30 Tage)
Charles McPherson
Charles McPherson am 10 Feb. 2016
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!

Antworten (0)

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by