Thanks again,

I like the idea of adding transparency. I will try it. For now, I resigned
myself to add points to the original barplot using points as such:

plotV<-barplot(Value[,1],space=0)
dev.off()

par(mar=c(4,5,3,1))
barplot(Value[,1],space=0, col="grey30",axis.lty=2)
points(plotV, sampledepth[,1]/(max(sampledepth[,1])/max(Value[,i])), pch=19,
col="black", xpd=TRUE)

#sampledepth[,1]/(max(sampledepth[,1])/max(Value[,i] is just to relativize
the values of sampledepth to fit the axis of the plot

Not exactly what I want but close to it. A continuous curve that represents
the "top" of the barplot would be ideal to represent sample depth (n) of
each class of Value. Stacking barplot will not provide what I am looking
for.

Thanks much for your suggestions, I will post an update if I find a way to
do exactly what I want. Still, implementing the argument "inside" in the
barplot function would be the way to go but I am lacking some time to
acquire the skills required to implement it.

Colin

On Fri, Jul 29, 2011 at 11:05 AM, Jannis <bt_jan...@yahoo.de> wrote:

> 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_jan...@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@r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/****listinfo/r-help<https://stat.ethz.ch/mailman/**listinfo/r-help>
>>>> <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<http://www.R-project.org/posting-guide.html>
>>>> >
>>>>
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>
>>>>
>>>>
>>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to