Get access to Marker handle of a line plot
6 ビュー (過去 30 日間)
古いコメントを表示
I trying to get acces of the "MarkerHandle" of a line plot:
h_plot = line(x,y); hMarkers = get(h_plot,'MarkerHandle');
It works great in case I am running the code in debug mode. Unfortunatelly, running the program in "normal" mode, I don't get access to the handle (results in "0×0 empty GraphicsPlaceholder array"). Any ideas?
1 件のコメント
Lukas Fricke
2018 年 5 月 3 日
Sounds like a concurrency issue to me. Did you try with an intermediate "drawnow"?
回答 (2 件)
Bhuvnesh Singh
2018 年 2 月 26 日
While using the line function try to mention the marker as the input to the function,
e.g:
h_plot = line(x,y,'Marker','o')
And then try to access the hMarkers =
get(h_plot,'MarkerHandle');
Paul Smits
2019 年 4 月 4 日
Matlab optimisation somehow destroys proper marker definitions.
Hack-solution: pause between creating the plot and fetching the markers.
h_plot = line(x,y);
pause(0.0000000001);
hMarkers = get(h_plot,'MarkerHandle');
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!