Printing normalized text labels on a plot
Show older comments
I am trying to make and print a plot with text labels using normalized units. See the code below to put 1 label 50% between the axes limits and a second label 25% of the way across (x-axis), 95% of the way up (y-axis).
a = zeros(2);
figure;
plot(a);
text(0.5, 0.5, 'Test Label 0.5, 0.5', 'Units', 'Normalized', 'fontsize', 20)
text(0.25, 0.95, 'Test Label 0.95, 0.25', 'Units', 'Normalized', 'fontsize', 20);
print('TestFigure', '-dpng');
The figure appears as intended in the figure window (screenshot below), but when I try to print the figure the text labels are offset from where they should be.
Figure window:

Printed figure:

Any help with printing the figure properly would be greatly appreciated. Thank you.
Accepted Answer
More Answers (1)
the cyclist
on 17 Oct 2017
1 vote
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!