Page 1 of 1

[SOLVED] plotting inertia ellipse only

PostPosted: Fri Sep 05, 2014 10:52 pm
by aolinto
Dear RGeoS Developers and Users,

I'm trying to draw a plot of the Center of Gravity and the Inertia using SI.cgi function. However I would like to represent in the plot only the inertia ellipse, without the gravity center and the inertia (the cross) as shown in Faraj, A., and Bez, N. 2007. Spatial considerations for the Dakhla stock of Octopus vulgaris: indicators, patterns, and fisheries interactions. ICES Journal of Marine Science, 64: 1820 – 1828, Figure 7.

In the code below when I write "flag.plot=T, flag.ellipse=T" both cross and ellipse are plotted but with "flag.plot=F, flag.ellipse=T" nothing is plotted.

Is there another way to plot the ellipse without the cross? Data I used to draw the plot (fisheries.RData) can be downloaded at https://app.box.com/s/4x3en1xjy5y7y8ghx5sn.

Thanks in advance,

Antonio

Code: Select all
data.db
data.db <- db.locate(data.db,"ARO","z",1) # indicate the variable
data.db

# Compute spatial indices
# Compute and plot the center of gravity, the inertia and the isotropy of the fish densities
x11()
plot(data.db,pch=21,bg.in=0,title="Center of gravity and inertia of densities and samples",inches=5,asp=1)
plot(poly,col=8,add=F)
polygon(costase.p,col=8);box()
res.cgi<-SI.cgi(data.db,flag.plot=T,flag.ellipse=T,col=4) # compute center gravity and inertia
res.cgi

code adapted from
R-script: Indices for capturing spatial patterns of fish population
Author: Mathieu Woillez, Ifremer

Re: plotting inertia ellipse only

PostPosted: Mon Oct 06, 2014 8:00 pm
by Didier Renard
in SI.cgi function, nothing is drawn if flag.plot=FALSE.
When flag.plot=TRUE, the inertia ellipse is only represented when flag.ellipse is TRUE.
Conversely the inertia axes are always represented.

I added an additional flag for the inertia axes.

This will be available in 10.0.5

Re: [SOLVED] plotting inertia ellipse only

PostPosted: Mon Oct 27, 2014 1:54 am
by aolinto
Thanks for your attention Renard.

Best regards,

Antonio Olinto