overlay with different scales but common 0 axis?

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.

overlay with different scales but common 0 axis?

Unread postby tclark » Fri Aug 21, 2020 3:09 pm

With charts that use two scales via overlay and related options, is there a way to have two scales but force the series to be plotted using the same aligned vertical axis at 0? If I just use overlay without same scale, the 0 axis for the ovcount series will normally differ from where the 0 axis is for the other series. Is there a way to have them use the same 0 but still have different scales apart from that? Thanks.
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
tclark
 
Posts: 85
Joined: Wed Nov 08, 2006 4:20 pm

Re: overlay with different scales but common 0 axis?

Unread postby TomDoan » Sat Aug 22, 2020 5:47 pm

You should be able to tweak it with MAX, MIN, OMAX and OMIN options. (If you think about it, the only way to do that is to pad the range of one of the series on the positive side and pad the other on the negative side.)

Code: Select all
set big 1 100 = %ran(10.0)
set little 1 100 = %ran(1.0)
ext big
compute bigmax=%maximum,bigmin=%minimum
ext little
compute littlemax=%maximum,littlemin=%minimum
compute bigmax=%max(bigmax,-bigmax)
compute littlemax=%max(littlemax,-littlemin)
graph(overlay=dots,max=bigmax,min=-bigmax,omax=littlemax,omin=-littlemax) 2
# big
# little
TomDoan
 
Posts: 7240
Joined: Wed Nov 01, 2006 5:36 pm

Re: overlay with different scales but common 0 axis?

Unread postby tclark » Sat Aug 22, 2020 7:04 pm

Great -- thanks very much
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
tclark
 
Posts: 85
Joined: Wed Nov 08, 2006 4:20 pm


Return to Graphics, Reports, and Other Output

Who is online

Users browsing this forum: No registered users and 3 guests