Edit plot adehabitatHS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Edit plot adehabitatHS

Luis Fernando García Hernández
Dear R experts,

I am making a selectivity analysis using the  package. Nevertheless, I am
having some troubles, and I would like to know if somebody know how to help
me:

1) When changing the x-axis labels. The programm uses the name habitat
instead of the names specified in the file.

2) Is it possible to edit this plot, #3 (bottom-left), for example is it
possible to change the symbols style, the legend position or size? I do not
know how to edit this kind of data, if somebody has an example using this
package, I would really appreaciate it.

Thanks!!

Please find attached the plot, the script and the respective plot


library(adehabitatHS)
pse<-read.table("pseudos.txt", header=T)

attach(pse)
names(pse)
head(pse)
(wiRatio <- widesI(Diet, Dis))
png(filename = "plotpseudos3.png", width = 500, height = 500)
opar <- par(mfrow=c(2,2))
plot(wiRatio)

par(opar)
dev.off()

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

pseudos.txt (550 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Edit plot adehabitatHS

Mathieu Basille-3
Hi Luis,

Late answer, but may still be useful. The function used in your case is
plot.wi, you can see the code that it actually uses by simply typing the
name of the function in R.

If you look at the help page, you will see that there is a list of graphic
parameters that you can adjust ('caxis', 'clab', 'ylog', 'errbar'), and
there's the magic '...' argument that is passed to 'plot'. But you won't be
able to change much with it, since all calls to 'plot' involve a 'type =
"n"' argument, which means nothing is plotted (yet)!

I'm afraid the only reasonable solution that you have is to actually *edit*
the function! You could write a 'plotwi' function that uses the code of
'plot.wi' with your modifications to tweak the plots the way you wish.

Hope this helps,
Mathieu.


Le 30/03/2015 00:06, Luis Fernando García a écrit :

> Dear R experts,
>
> I am making a selectivity analysis using the  package. Nevertheless, I am
> having some troubles, and I would like to know if somebody know how to help
> me:
>
> 1) When changing the x-axis labels. The programm uses the name habitat
> instead of the names specified in the file.
>
> 2) Is it possible to edit this plot, #3 (bottom-left), for example is it
> possible to change the symbols style, the legend position or size? I do not
> know how to edit this kind of data, if somebody has an example using this
> package, I would really appreaciate it.
>
> Thanks!!
>
> Please find attached the plot, the script and the respective plot
>
>
> library(adehabitatHS)
> pse<-read.table("pseudos.txt", header=T)
>
> attach(pse)
> names(pse)
> head(pse)
> (wiRatio <- widesI(Diet, Dis))
> png(filename = "plotpseudos3.png", width = 500, height = 500)
> opar <- par(mfrow=c(2,2))
> plot(wiRatio)
>
> par(opar)
> dev.off()
>
>
>
> _______________________________________________
> R-sig-ecology mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

--

~$ whoami
Mathieu Basille
http://ase-research.org/basille

~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314

~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology