How can I update the histogram plot using LINKDATA function in MATLAB 7.8 (R2009a)?
显示 更早的评论
I generate two histogram plots that I would like to link to the data in my workspace:
x = -4:0.1:4;
y = randn(1000,2);
figure
subplot(2,1,1)
hist(y(:,1),x)
subplot(2,1,2)
hist(y(:,2),x)
I try to use LINKDATA but it does not link the data correctly because the data plotted on the histograms is part of a matrix.
linkdata on
y = randn(1000,2);
When I was using the PLOT command I was able to specify the 'YDataSource' of the plot and that would specify the data linking:
figure
plot(y(:,1),'YdataSource','y(:,1)')
linkdata on
y = randn(1000,2);
However, I cannot use the same approach for my problem because the histogram object does not seem to have the 'YDataSource' property. I would like to use the LINKDATA function and not the Data Linking tool in the figure toolbar.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!