How to create text annotation over a place of subplot

16 次查看(过去 30 天)
I'm trying to draw the statistics section but I couldn't do it.
% figure
figure, subplot(2,3,1), imshow(I), title('Original');
subplot(2,3,2), plot(x,y,'LineWidth', 3), axis([0 255 0 255]), title('Transformation function: I = I+128'), axis square;
subplot(2,3,3), imshow(I1), title('I+128'); %display
subplot(2,3,4), imhist(I), title('Original Histogram');
subplot(2,3,5), annotation('textbox','String',str)
subplot(2,3,6), imhist(I1), title('Modified Histogram');
The annotation part is not working like i want and gives this output

回答(1 个)

Star Strider
Star Strider 2021-6-1
In the documentation Create Text Box Annotation, the textbox can take a dim vector that describes the size and location of the textbox. Experiment with those values to create the correct size and position for it.
Alternatively, use a text object in the specific subplot. That might be easier.

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by