[R] plots

Jim Lemon jim at bitwrit.com.au
Fri Mar 14 20:57:14 CET 2014


On 03/14/2014 06:55 PM, Renalda Munubi-Misinzo wrote:
> I would like to have a  plot with values in a reversed order (as shown in
> fig 2).  I tried to plot the graph in R using the following codes
>
> plot(density,depth,pch=as.numeric(species),xlab="fish density
> (#/m2)",ylab="water depth (m)")
>
> legend(locator(n=1),legend=c("Tropheus brichardi","Petrochromis
> kazumbe"),pch=1:2)
> unfortunately I can not reverse the axis to get a plot like the one shown
> in fig.2 Please can you help me with the codes?
>
Hi Renny,
Your image did not make it through to the list, but if David's 
suggestion isn't what you want, have a look at the rev.axis function in 
the plotrix package.

Jim




More information about the R-help mailing list