text alignment in plots ignores margin
4 ビュー (過去 30 日間)
古いコメントを表示
If I do
h = text(0,0,'hallo','VerticalAlignment','top','margin',10)
I expect that verticalAlignment referes to the top of the box defined by margin. Unfortunately this is not the case. Instead it is alway the top of the text. However, when placing, e.g, text to a marker I would like to add some space between marker and text. Is there any option to accomplish this?
Thank you very much.
0 件のコメント
回答 (1 件)
Jaimin
2024 年 10 月 11 日
You can manually set the margin between the marker and text using the “set” function.
Kindly refer to the following code snippet for better understanding. In this snippet, “x_marker” and “y_marker” represent the <x, y> position of a marker, while “test_height” and “margin” denote the expected height and margin.
set(h, 'Position', [x_marker, y_marker + text_height + margin, 0]);
For more information on “set” function kindly refer following MathWorks Documentation.
I hope this will helpful.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!