Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to flip axis on an image?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!