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