سؤال

Does anyone know a good way to reverse an axis lets say the y-axis, without effecting the plot, in the function image?

Lets say I want to make the following plot

image(1:10,1:10,matrix(1:100,10,10)).

This works fine but what if I want to display my y-axis going from 10:1. image doesn't let you do image(10:1,1:10,matrix(1:100,10,10)). Do I have to create my own axis and add them to the plot or is there a simpler way?

هل كانت مفيدة؟

المحلول

Using ylim:

image(1:10,1:10,matrix(1:100,10,10), ylim=c(10,1))
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top