[R] plots
David Carlson
dcarlson at tamu.edu
Fri Mar 14 17:08:28 CET 2014
R-help strips attachments so your post has three problems:
1. No plot to look at
2. No data to replicate your code
3. Email is in html format instead of plain text
Try again using plain text mail, copy the results of
dput(your.data.frame) into your email and provide code that
generates the figure and then tell us how it should be
different.
It is likely that the solution is simple, eg
set.seed(42)
depth <- runif(10)*10
density <- rnorm(10, 5)
plot(density, depth) # normal
plot(density, depth, ylim=c(10, 0)) # reversed
-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352
-----Original Message-----
From: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org] On Behalf Of Renalda
Munubi-Misinzo
Sent: Friday, March 14, 2014 2:55 AM
To: r-help at r-project.org
Subject: [R] plots
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?
Thanks you
Renny
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible
code.
More information about the R-help
mailing list