[R] Contour on top of 2d histogram

Sramkova, Anna (IEE) anna.sramkova at iee.unibe.ch
Thu Nov 17 09:42:00 CET 2011


Hi,

thanks for the suggestion!

I had tried it before, but it did not work - this was probably because I was using the "image" function to 
plot the 2d histogram. When I use directly hist2d and then contour with add=T it works.

Thanks again

Anna
________________________________________
Von: R. Michael Weylandt [michael.weylandt at gmail.com]
Gesendet: Mittwoch, 16. November 2011 18:43
Bis: Sramkova, Anna (IEE)
Cc: r-help at r-project.org
Betreff: Re: [R] Contour on top of 2d histogram

Try the add = TRUE argument to contour.

Michael

On Wed, Nov 16, 2011 at 12:35 PM, Sramkova, Anna (IEE)
<anna.sramkova at iee.unibe.ch> wrote:
> Hi all,
>
> I would like to plot one data set as a 2d histogram and another one as a contour. I can do it separately with the
> "hist2d" and "contour" functions, but I wonder if there is a way to combine these two plots into a single one (the ranges of the two plots are the same).
>
> Any suggestions?
>
> Thanks,
>
> Anna
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list