[R] Query on contour plots

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Mon Jun 1 01:36:23 CEST 2020


Hi Neo,
It's a bit of a guess, but try this:

bat_call<-read.table(text="Fc      Sc
26.58   -5.95
27.03   -8.2
27.16   -2.07
26.19   -7.68
26.62   -3.99
26.85   -6.08
26.94   0
26.1    -5.74
26.62   -5.96
26.85   -4.05
26.98   -4.09
26.02   -5.69
26.53   -7.89
26.62   -2
26.8    -4.04
28.73   7
25.72   -2.97
26.14   -5.76
26.32   -3.89
26.4    0
26.32   5.88",
header=TRUE)
library(plotrix)
color2D.matplot(makeDensityMatrix(bat_call$Fc,bat_call$Sc,nx=5,ny=5,
 zfun="sum",xlim=range(bat_call$Fc),ylim=range(bat_call$Sc)),
 main="Map of bat calls",extremes=c("blue","red"),xlab="Frequency",
 ylab="Characteristic slope",axes=FALSE)
axis(1,at=seq(0.5,4.5,1),seq(26.3,28.3,0.5))
axis(2,at=seq(0.5,4.5,1),seq(4,-11.2,-3.5))
color.legend(-0.5,-0.65,1,-0.45,legend=seq(0,4,length.out=5),
 rect.col=color.scale(0:4,extremes=c("blue","red")),align="rb")
text(0.25,-0.89,"Density",xpd=TRUE)

Jim

On Mon, Jun 1, 2020 at 3:16 AM Neotropical bat risk assessments
<neotropical.bats using gmail.com> wrote:
>
> Hi all,
>
> While exploring  packages for 3D plots that several folks suggested (Tnx
> all!)
> It seems what I really need is a contour plot.  This is not working int
> he Deducer GUI.
>
> This will be an aid to separating bats by their vocal signatures.
> What I need to do is plot *Fc *against *Sc* with the third dimension
> being the *density* of the data points in the Fc-Sc plot.
>
> Data format is like this abbreviated sample.  Fc is a frequency in kHz
> and Sc is the characteristic slope  (octaves per second) of each call pulse.
>
> Any suggestions, guidance greatly appreciated.
> Bruce
>
> Fc      Sc
> 26.58   -5.95
> 27.03   -8.2
> 27.16   -2.07
> 26.19   -7.68
> 26.62   -3.99
> 26.85   -6.08
> 26.94   0
> 26.1    -5.74
> 26.62   -5.96
> 26.85   -4.05
> 26.98   -4.09
> 26.02   -5.69
> 26.53   -7.89
> 26.62   -2
> 26.8    -4.04
> 28.73   7
> 25.72   -2.97
> 26.14   -5.76
> 26.32   -3.89
> 26.4    0
> 26.32   5.88
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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