The idiom of 'par(new=TRUE)' should be hidden, it is never the first thing
that you should try and is only rarely needed and as you have seen often
causes more problems than it helps.

First you should ask yourself if using 2 different coordinate systems in
the same plot is the best approach, you can search the archives for other
discussions of  this.

Your second plot is using type="h" so it is possible that the rugplot
function may give you what you want.

Another option is use the segments function to add to an existing plot.

If you really need 2 different coordinate systems then use the twoord.plot
function from the plotrix.

If you really want to do it the above way then you can supress the drawing
of axes with commands like axes=FALSE or yaxt='n'.

Also note that T can be FALSE and F can be TRUE so it is better in general
to use the full versions.


On Thu, Dec 27, 2012 at 10:59 AM, skpark <birdfir...@naver.com> wrote:

> Hello,
>
> I'd like to draw 2 plots in one graph.
> Here is my code:
>
>
>   plot(data_min1$macd,main="1 min MACD",type="l")
>   lines(data_min1$macdsig,col="red")
>   par(new=T)
>   plot(data_min1$macdhist,type="h",main="")
>   axis(4)
>   par(new=F)
>
> It seems it works.
> But left axes of two graphs are over-drawn.
>
> Could you let me know how to fix it ?
>
> BR,
> SK Park
>
>
>         [[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.
>



-- 
Gregory (Greg) L. Snow Ph.D.
538...@gmail.com

        [[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