[R] Overlapping axis numbering and labels when using par(new=TRUE)?

David Winsemius dwinsemius at comcast.net
Mon Sep 19 23:06:03 CEST 2016

> On Sep 19, 2016, at 8:50 AM, mviljamaa <mviljamaa at kapsi.fi> wrote:
> I'm trying to plot two data sets on the same plot by using par(new=TRUE).
> However this results in the axis numbering and labels being plotted twice as seen in the following picture:
> http://i.imgur.com/4b1sNIc.png
> How can I get the axis numbering and labels to not overlap? I could also manage with plotting only the axis numbering and labels of the other plot, but not of the other.

You need to set the ylim values of both plots to the same range, and suppress plotting of the ylab in one of hte plot calls.

> ______________________________________________
> R-help at r-project.org 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.

David Winsemius
Alameda, CA, USA

More information about the R-help mailing list