Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to flip axis on an image?
1 次查看(过去 30 天)
显示 更早的评论
So, I have an image with an axis, but the axis is flipped compared to how I want it. The axis variables are t, and if I first say t = flip(t), I now get the correct image with the axis correct, but it is now upside down.
I have looked at other Matlab questions, for example
But the solutions presented dont solve my problem. The best solution I have found so far is the following code
yLimits = get(gca,'YLim'); %# Get the y axis limits
yTicks = t(end)+t(1)-get(gca,'YTick'); %# Get the y axis tick values and
%# subtract them from the upper limit
set(gca,'YTickLabel',num2str(yTicks.')); %'# Convert the tick values to strings
%# and update the y axis labels
This works, the axis is correct, and the image is the correct way up, but the choice of ticks is now wierd. Instead of having ticks at 0, 0.1, 0.2, etc, I have ticks at 0.11334 and other strange values. I have really tried everything with this. Why does doing t = flip(t) also flip the image?
1 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!