[R] "inside" argument in barplot

Jannis bt_jannis at yahoo.de
Fri Jul 29 19:05:22 CEST 2011


Why dont you plot a stacked barplot with the two values for each depth 
(or whatever is on the x axis) besides each other? Another option would 
be to add transparency to the fill color of the plot (col=rgb(1,1,1,0.5)).

On 07/29/2011 05:21 PM, Colin Bergeron wrote:
> Thanks Jannis,
>
> I am including an example code of what I am trying to do:
>
>      par(mar=c(4,5,3,1))
>      barplot(Value[,1],space=0, col="grey30",axis.lty=2)
>      barplot(sampledepth[,1]/2, space=0, col="grey30", inside=FALSE,
> add=TRUE)
>
> sampledepth is divided by two to have the same axis scale as Value and I can
> put another axis on the right of the plot no problem. I just want the
> inside=FALSE so I still can see the top of the bars of the barplot but not
> the inside. That way I still can see the other barplot which represent the
> value. The problem is that inside=FALSE is not yet implemented.
>
> Colin
>
>
> On Fri, Jul 29, 2011 at 9:02 AM, Jannis<bt_jannis at yahoo.de>  wrote:
>
>> Dear Collin,
>>
>>
>> as always, a reproducible example code would help us to understand what you
>> want to do. This way I can only guess....
>>
>> And my guess would be that it is much easier to use:
>>
>> par(new=TRUE)
>>
>> and to superimpose the barplot with whatever curve you want to include. You
>> may need to set the x/y limits of the two plots to be identical.
>>
>>
>> HTH
>> Jannis
>>
>>
>>
>> On 07/29/2011 04:29 PM, Colin Bergeron wrote:
>>
>>> Dear list,
>>>
>>> I want to plot a sample depth curve over a barplot. It would be perfect if
>>> the argument "inside" in the barplot function would be functional, cause I
>>> could just add this curve to the actual barplot, but it seems like it is
>>> not
>>> (not yet implemented). Argument "inside" would allow not to plot the line
>>> dividing two bars and using a null color within these bars would allow
>>> superposition with the actual bar plot and indicate the sample depth.
>>>
>>> Do you have any suggestions or experience to share?
>>>
>>> Colin
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> ______________________________**________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>> PLEASE do read the posting guide http://www.R-project.org/**
>>> posting-guide.html<http://www.R-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>>
>



More information about the R-help mailing list