How to rotate xline label with vertical orientation?
26 次查看(过去 30 天)
显示 更早的评论
Hello, in my figure I have a xline with a label. The orientation of this label is vertical and can be read from the bottom to the top of the figure. I need a rotated label, always in a vertical orientation but readable from the top to the bottom. Is it possible?
Many thanks,
Sofia
0 个评论
采纳的回答
Shivam
2024-9-5
Hi Sofia,
You can follow the workaround mentioned to get the text label in vertical orientation but readable from the top to the bottom.
% Add an xline
xlinePosition = 5; % Example position for the xline
xline(xlinePosition, 'Color', 'r', 'LineWidth', 2);
% Add a custom text label for the xline
labelText = 'My Label';
% Adjust y position and 'VerticalAlignment' as needed
text(xlinePosition, max(y), labelText, 'Rotation', -90, ...
'VerticalAlignment', 'bottom', 'HorizontalAlignment', 'left');
You can make the position adjustments of the line and text label according to your needs.
I hope it is helpful.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!