![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181283/image.png)
How to label display image at different location ?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi Mathwork Community,
How to label the image at the different location. Using a text function we can add the text at a different position. If display image displayed at various parts and wants to label it. I guess it will be clear from the example. Please find the image I wanted a label at the position shown in the figure Will appreciate your help.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172054/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172055/image.png)
0 件のコメント
回答 (1 件)
Gopichandh Danala
2018 年 4 月 12 日
I am assuming that you have a single image consisting of 7 sub-images.
img = imread('Problem.png');
[nrow, ncol,~] = size(img);
num_images = 7;
one_img_width = ncol/num_images;
shift = one_img_width/2;
col_locs = shift: one_img_width:ncol - shift; % col positions
row_locs = repmat(nrow+10, [1,num_images]); % row positions
txt_vals = {'Fig (a)', '(b)','(c)','(d)','(e)','(f)','(g)'};
figure, imshow(img,[]), title('Different texture samples')
text(col_locs,row_locs,txt_vals)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181283/image.png)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!