Datatip
16 ビュー (過去 30 日間)
古いコメントを表示
Hello!
I have a question regarding datatip on my GUI graph. Everytime I run my GUI and select Data Cursor I have to right click on graph and select my datatip file. The graph opens up the default one(X : xxxx, Y : yyyy). Mine shows date and mass. It's just a bit annoying opening up everytime... Can I change this by making it default for this GUI file?
Thank you in advance!
0 件のコメント
採用された回答
Fangjun Jiang
2011 年 12 月 12 日
I assume you have your data tip function, you can set it when you enable the data cursor mode.
%%Original data
f=figure;
h=plot(rand(10,1));
dcm=datacursormode(f);
datacursormode on;
set(dcm,'updatefcn',@MyDataTipFunction);
4 件のコメント
Fangjun Jiang
2011 年 12 月 12 日
Your GUI graph is already a figure. So when you enable its data cursor mode, you need to get the handle of your GUI graph, then do the dcm=datacursormode(FigureHandle) and then set(dcm,...).
その他の回答 (3 件)
Thomas Flick
2018 年 5 月 31 日
This is an old post but as far as I can tell the problem has not been satisfactorily solved in that there is no proposed solution that is as easy as setting a default. Here is one that is that easy:
(1) Make a new shortcut or favorite. This requires a fairly new version of Matlab.
(2) Copy/paste this code into your favorite:
dcm=datacursormode(gcf);
datacursormode on;
set(dcm,'updatefcn',@MyDataTipFunction);
(3) While viewing your plot, click on your "favorite" button. This puts the plot in data cursor mode using your data tip function.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Specifying Target for Graphics Output についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!