Image axis label reshape
1 次查看(过去 30 天)
显示 更早的评论
I have an (mxn) image. When I use interpolation and display the image to the original size (mxn), the X and Y ticks are off. How do I fix it?
For example: 1.) I is an (mxn) image. 2.) [mp, np] = size( interp2(I, 4) ); 3) How do I do this part? imageSizeRadial is the size of the object in radial direction. Let's say it is 0.7 mm.
ax.XTick = (where_to_start : .35 : imageSizeRadial) * floor(np/imageSizeRadial); ax.XTickLabel = {10, 360, 710};
we record the image at 10 micro-meter. Hence the first tick should be 10 micrometer.The problem is that he tick is below the surface.
Same applies to the Y label
Please see the attached figure.
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161162/image.jpeg)
>>
I would like to place a tick in .010 mm, 0.36 mm, 0.71 mm.
2 个评论
Vandana Rajan
2017-2-28
Hi,
Can you put this pic as an attachment? The details are not really visible.
回答(1 个)
Adam
2017-2-28
If you use the
imagesc( hAxes, x, y, C )
form of plotting the image then you can tell it what the x range and y range of your image is so that even if you interpolated the actual data to e.g. 1000 x 1000 you can tell it that the x data is [0 100] and the y data is [0 50] or whatever you want - i.e. you can just give it your original uninterpolated image sizes, assuming they were correct. I'm not really understanding from your question what exactly is wrong and what it should look like. You seem to be assuming bits and pieces of domain knowledge in your question rather than just pure matlab image plotting
2 个评论
Adam
2017-2-28
I can't run your code as I don't have 'monteCarloStartOffset', amongst possibly other things.
Did you try giving the xData and yData to imagesc though? The first tick in that case should be at whatever you tell it is the xData minimum and the same for yData.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!