How to alpha entire plot?

How to alpha entire plot?

I have two chromatograms I want plotted on the same axes.
I would like the plots to be transparent, so the first chart is
not obscured.

I have tried adjustcolor(..., alpha.f=0.3), the problem is that
my chromatogram is so dense with datapoints that they
overlap and the entire graph just ends up a solid color. The
second histogram still obscures the first.

Re: How to alpha entire plot?

Interesting problem.

I would discretize the x-values and interleave them. Lines from one dataset still overlap, so you see high- density and low-density regions, but lines from the other dataset are drawn into the interval. Like so:

> On 2018-05-31, at 16:56, Ed Siefker <[hidden email]> wrote:
>
> I have two chromatograms I want plotted on the same axes.
> I would like the plots to be transparent, so the first chart is
> not obscured.
>
> I have tried adjustcolor(..., alpha.f=0.3), the problem is that
> my chromatogram is so dense with datapoints that they
> overlap and the entire graph just ends up a solid color. The
> second histogram still obscures the first.
>
> Consider this example:
>
>
> col1 <- adjustcolor("red", alpha.f=0.3)
> col2 <- adjustcolor("blue", alpha.f=0.3)
> EU <- data.frame(EuStockMarkets)
> with(EU, plot(DAX, CAC, col=col2, type="h", ylim=c(0,6000)))
> par(new=TRUE)
> with(EU, plot(DAX, FTSE, col=col1, type="h", ylim=c(0,6000)))
>
> The density of the red plot around 2000 completely obscures the blue
> plot behind it.
>
> What I would like to do is plot both plots in solid colors, then alpha
> the entire thing, and then overlay them. Or some other method that
> achieves a comparable result.
> Thanks
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

> I have two chromatograms I want plotted on the same axes.
> I would like the plots to be transparent, so the first chart is
> not obscured.
>
> I have tried adjustcolor(..., alpha.f=0.3), the problem is that
> my chromatogram is so dense with datapoints that they
> overlap and the entire graph just ends up a solid color. The
> second histogram still obscures the first.
>
> Consider this example:
>
>
> col1 <- adjustcolor("red", alpha.f=0.3)
> col2 <- adjustcolor("blue", alpha.f=0.3)
> EU <- data.frame(EuStockMarkets)
> with(EU, plot(DAX, CAC, col=col2, type="h", ylim=c(0,6000)))
> par(new=TRUE)
> with(EU, plot(DAX, FTSE, col=col1, type="h", ylim=c(0,6000)))
>
> The density of the red plot around 2000 completely obscures the blue
> plot behind it.
>
> What I would like to do is plot both plots in solid colors, then alpha
> the entire thing, and then overlay them. Or some other method that
> achieves a comparable result.
> Thanks
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>