Hi everybody, well I'm trying to use barplot for the first time. I get a suitable graphic but I'm having a weird problem. My graphic is generated from a matrix with several species (rowNames) and two abundance columns. So each species will have two bars, and the species name should appear at left. Until now everything is Ok, but when a I plot it the species names (my labels) are cut by device limits, and only part of the names appear. I could move them with the command "line=some negative value", but the axis (x and y) stay put and the things get over each other (the command 'line' works, but a error saying that it's not a graphic parameter appears). In addition, but with less importance, how could I remove the legend borders? And why, when I try use the 'width' command it fails to raise the width of the bars and I get and error saying that its not a graphic parameter (the command is in barplot help!!)? I'm using R 2.8.0 at Windows XP 32 bits. Here is the code I'm using, where MainSpp is my matrix: barplot(MainSpp,horiz=T,beside=T,main='Main Species',xlab='%',las=1, legend.text=T,width=5,cex.names=0.8) Thank you for your attenction. ___________________________________ MSc. Rodrigo Aluizio Centro de Estudos do Mar/UFPR Laboratório de Micropaleontologia Avenida Beira Mar s/n - CEP 83255-000 Pontal do Paraná - PR - BRASIL [[alternative HTML version deleted]]
Dear R team Jim Lemon recently said regarding new improvements in PrettyR and plotrix: ?Remember, it is your whingeing and moaning that have helped to make these packages what they are today.? So, this is my whinge: out there is a freeware called Vista, which runs, among other things, bootstrap analyses. Most of the numerical reports given by Vista can be done using packages such as ?boot?, ?bootstrap?, and ?simpleboot?. I?ve not explored all the functions in these packages thoroughly (very casually), but the first thing I noticed is that the graphical output is majorly histograms. Vista offers a so-called Multiple Visualisation (MV) of the output of a bootstrap (it shows on the same window scatter plots for a particular variable showing the bootstrapped CI, a scatter plot of the evolution of the bootstrapped mean over many sample sizes, a box plot, a QQ plot, and a histogram). I wonder if there is any manner in which this sort of MV could me mimicked by R in the case of bootstrap. My best guess is that I?d have to create a 3 by 2 frame an insert each graph separately or maybe resort to Trellis graphics am I right? Does anyone have a more sophisticated solution? Cheers, Fer
Rodrigo Aluizio wrote:> Hi everybody, > well I'm trying to use barplot for the first time. I get a suitable graphic but I'm having a weird problem. > My graphic is generated from a matrix with several species (rowNames) and two abundance columns. > So each species will have two bars, and the species name should appear at left. Until now everything is Ok, but when a I plot it the species names (my labels) are cut by device limits, and only part of the names appear. > I could move them with the command "line=some negative value", but the axis (x and y) stay put and the things get over each other (the command 'line' works, but a error saying that it's not a graphic parameter appears). In addition, but with less importance, how could I remove the legend borders? And why, when I try use the 'width' command it fails to raise the width of the bars and I get and error saying that its not a graphic parameter (the command is in barplot help!!)? > > I'm using R 2.8.0 at Windows XP 32 bits. > > Here is the code I'm using, where MainSpp is my matrix: > > barplot(MainSpp,horiz=T,beside=T,main='Main Species',xlab='%',las=1, > legend.text=T,width=5,cex.names=0.8) > >Hi Rodrigo, I think that the staxlab function in the plotrix package might do what you want. For the legend problem, I would suggest not using the barplot legend option but using the legend function with bty="n". Jim
Hi List, well I’ve already asked this before, but I can’t figure out a solution for the problem after trying many different ways. So I writing again… I’m using barplot function. I pretend to create a horizontal barplot with two different information (side by side) for a species list. Well I can generate the graph easily, but the problem is that the labels with the species names are cut by device window!! I’ve tried lots of par functions none seems to work properly. Below are the script. Height is a matrix of species and two column of numerical data. I used par(las=) function to make the labels horizontal. When I do this they are cut by the device window. If I don’t do that the label stay vertical and make nonsense with the graph. library(xlsReadWrite) Spp<-read.xls('SppPrincipaisFVeFT.xls',sheet=1,rowNames=T) Spp<-as.matrix(Spp) barplot(t(Spp),axis.lty='solid',horiz=T,beside=T,las=1,col=c('lightgray','bl ack'),main='Main Speceis') legend('topright',c('Living Fauna','Dead Fauna'),fill=c('lightgray','black'),bty='n') Thanks for your attention ___________________________________ MSc. <mailto:r.aluizio@gmail.com> Rodrigo Aluizio Centro de Estudos do Mar/UFPR Laboratório de Micropaleontologia Avenida Beira Mar s/n - CEP 83255-000 Pontal do Paraná - PR - BRASIL [[alternative HTML version deleted]]