Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Combining seperate graphs into one


From   tashi lama <ltashi32@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Combining seperate graphs into one
Date   Thu, 7 Jun 2012 14:39:00 +0000

I have tried this option before and did it again after this post. With this command, having two xaxis complicates the graph than simplifies it. What this command does is place one axis at the bottom(which is convention) and other on the top of the graph(which makes no sense). I was actually trying to run two diff time series graphs with same date variable. Sth like this 

 

date          var1   var2 

01jan2010      2      1

02jan2010      4      9

 

twoway line var1 date, yaxis(1) || area var2 date, yaxis(2) 

 

This is fine because it creates a single chart with two yaxis on opposite sides. but one common xaxis. The problem is since I am drawing a twoway area for var2, it covers the line chart of var1. That is why I wanted to have two xaxis one top of other to avoid overwritten graphs. One way was to check with xaxis(#) which you suggested, but weirdly it does the same exact thing except puts xaxis(2) on top of the chart which doesn't help at all. 

 I could have used graph combine to create chart with diff y and x axis but I was tryin to 

 

1. avoid extra steps for saving graphs to combine 

2. picture them as a single chart than two charts(diff y and xaxis) 

 

Thanx anyway...

 

 

 

 
----------------------------------------
> Date: Thu, 7 Jun 2012 01:00:42 +0100
> Subject: Re: st: Combining seperate graphs into one
> From: njcoxstata@gmail.com
> To: statalist@hsphsun2.harvard.edu
>
> twoway <whatever> y1 x1 || <whatever> y2 x2
>
> On Wed, Jun 6, 2012 at 8:26 PM, tashi lama <ltashi32@hotmail.com> wrote:
>
> > Is there a command to have two charts in diff. xaxis, one top of other both starting with yaxis=0? Yaxis could be on the same side or opposite sides.
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/ 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index