Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> The contour lines are actually useful to see groupings. > However w/o a legend for density it is not possible to see what is > presented. I need to re-iterate, that the diagonal lines, may be important. Also, I'm not sure I see the point in adding density values. Unless people have a good

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> that extraneous white lines in PDFs are the fault of the PDF > viewing program rather than of R. Except it's a PNG file. I've tried to minimize artifacts viewing PDF files. But assumed (falsely?) that PNGs and other raster formats, would be fine.

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Tnx Jim, Yes if there is a way to first extract the ranges of each data files Fc range and Sc ranges and then link to the plot that would be stellar. I will look at this code and see how it is working so far. Thanks a million. Bruce Hi Bruce & Abby, Here is a start on merging the two plots.

Re: [R] Query on contour plots

2020-06-02 Thread David Winsemius
On 6/2/20 11:44 AM, Abby Spurdle wrote: Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this approach. In my plot, the contour lines could be removed, and brighter colors could be used. But perhaps,

Re: [R] Query on contour plots

2020-06-02 Thread Jim Lemon
Hi Bruce & Abby, Here is a start on merging the two plots. Abby - I had to cheat on the legend colors as I could not work out from the help pages how to specify the range of colors. Also I don't know the range of densities. Both should be easy to fix. While I specified xlab and ylab, they don't

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi Abby, The contour lines are actually useful to see groupings. However w/o a legend for density it is not possible to see what is presented. Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this approach. In my plot, the contour lines could be removed, and brighter colors could be used. But perhaps, a better approach would be to model those

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi all, I spent some time this morning fiddling with the parameters in the plot code provided by Jim and Abby and  by changing some important ones. Jim did note *# set the matrix limits a bit beyond the data ranges* fcsc_mat<-makeDensityMatrix(bfs$Fc,bfs$Sc,nx=100,ny=100,  

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi all, Many thanks for the efforts and suggestions. This is getting closer to what is needed.  No legend showing the density values yet. I was able to replicate a similar plot with the original data set. However when I tried this with a different data set that has other Fc & Sc values  the

Re: [R] Query on contour plots

2020-06-02 Thread Jim Lemon
Very nice. I forgot that you didn't have the complete data set. png("as_bat_call.png") plot_ds (bfs[,c("Fc","Sc")], "plot 1", xlim = c (25, 30), ylim = c (-15, 10), k1=1.25, k2=1.25) dev.off() Jim On Tue, Jun 2, 2020 at 6:24 PM Abby Spurdle wrote: > > I'm putting this back on the list.

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
I'm putting this back on the list. > So how would I set up the code to do this with the data type I have? > I will need to replicate the same task > 200 times with other data sets. > What I need to do is plot *Fc *against *Sc* with the third dimension being > the *density* of the data points.

Re: [R] Query on contour plots

2020-06-01 Thread Jim Lemon
Good morning Bruce & Abby, The fruit bats of Sydney have retreated to their camps so I can finally answer your last two queries. Attached is a plot of your data set on a 100 x 100 grid. This is how I did it: bfs<-read.csv("Procen_sample.csv") dim(bfs) names(bfs) library(plotrix) # set the matrix

Re: [R] Query on contour plots

2020-06-01 Thread Abby Spurdle
Hi, I'm probably biased. But my package, bivariate, contains a wrapper for KernSmooth::bkde2D, which can produce both 3D surface plots and (pretty) contour plots of bivariate kernel density estimates, conveniently. https://cran.r-project.org/web/packages/bivariate/vignettes/bivariate.pdf (pages

Re: [R] Query on contour plots

2020-05-31 Thread Jim Lemon
Hi Bruce, With a much larger data set, you would see a smoother plot like your sample. I plotted frequency as the abcissa and slope as the ordinate. It looks as though your sample has it the other way round and the plot limits are extended beyond the range of the data. However, makeDensityMatrix

Re: [R] Query on contour plots

2020-05-31 Thread Jim Lemon
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

[R] Query on contour plots

2020-05-31 Thread Neotropical bat risk assessments
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