Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: create two xaxis one top of other to avoid overlapping

From   tashi lama <>
To   <>
Subject   st: create two xaxis one top of other to avoid overlapping
Date   Tue, 5 Jun 2012 15:24:16 +0000

I have a timeseries date as follows


date            var1      var2

01jan2010        2         5

02jan2010        0         4 

03jan2010        3         8

04jan2010        5         6



First thing is I checked if I could combine tsline and twoway command and great, it works. So, 


tsline var1, yaxis(1) || area var2 date, yaxis(2)   will give a combined graph but because the data for var1 and var2 aren't that diff, they overlap at various places. I could 'yscale' but overlap still exists as you might well know because of the nature of my dataset. The solution I can think of is creating two x axis one top of other. One xaxis will be for date and var1 and other will be for date and var2. And both xaxis should start from yaxis=0. I tried doing sth like this...


tsline var1, yaxis(1) xaxis(1) || area var2 date, yaxis(2) xaxis(2)    but would only add xaxis on top of the chart, which doesn't help. In essence I am trying to create sth like market chart in yahoo finance where they have volumes in one xaxis and price in diff xaxis... 

Any idea will be highly appreciated?



*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index