add scale bar to image
이전 댓글 표시
How to add scale on the horizontal axis on an image (not on a graph). the image length density is 0.101mm/pixel. How can i just show the scale below the image.
채택된 답변
추가 답변 (1개)
Joshua Brockman
2017년 9월 25일
0 개 추천
I often use Matlabs quiver plot with the arrow head turned off to add a vector (which will appear as a bar) to your image.
The way I do this:
figure; imshow(YourImage) hold on
% Pixel Size = size of pixel within your image % Scalebar_length = Desired scale bar length % x_location and y_location are wherever you want your scale bar to appear. quiver(x_location,y_location,Scalebar_length/PixelSize,0,'ShowArrowHead','off')
댓글 수: 1
Rob Campbell
2019년 7월 25일
I tried this method and noticed when I labelled the bar by putting text where the center of the bar should be (with 'horizontalalignment' as 'center'), the text was always offset a bit. In figuring that out I found that the bar produced with quiver is a little longer than it ought to be. Better to use plot to do that.
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!