Axis scaling

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

catherinebrunet2
Posts: 5
Joined: Tue Sep 01, 2015 12:32 pm

Axis scaling

Postby catherinebrunet2 » Tue Sep 01, 2015 12:40 pm

Hi,

I am using a program to do my graphs and I would like to know if it is possible to adjust the axis scales such that all my graphs have the same min and max scale? For instance, I want to freeze together two graphs that have the same independent variable (which is scaled from 0 to 100%), and thus would like the y-axis to be from 0 to 100 for both graphs. What would be the code or command to add to my current program? (see below)

Thank you!

smpl 1990 1990
graph gp_lac_hc6_a.bar(contract=last, rotate) lac_arg_hc6 lac_bol_hc6 lac_bra_hc6 lac_cl_hc6 lac_col_hc6 lac_cr_hc6 lac_dr_hc6 lac_ec_hc6 lac_es_hc6 lac_ga_hc6 lac_ho_hc6 lac_mex_hc6 lac_nic_hc6 lac_pan_hc6 lac_par_hc6 lac_per_hc6 lac_ur_hc6 lac_vz_hc6
gp_lac_hc6_a.addtext(t, font(Calibri, 12, b)) Selected LAC Countries - Richness lines (Above 125% of median inc.) in 1990
gp_lac_hc6_a.setobslabel(1) Argentina
gp_lac_hc6_a.setobslabel(2) Bolivia
gp_lac_hc6_a.setobslabel(3) Brazil
gp_lac_hc6_a.setobslabel(4) Chile
gp_lac_hc6_a.setobslabel(5) Colombia
gp_lac_hc6_a.setobslabel(6) Costa-Rica
gp_lac_hc6_a.setobslabel(7) Dominican Rep.
gp_lac_hc6_a.setobslabel(8) Ecuador
gp_lac_hc6_a.setobslabel(9) El-Salvador
gp_lac_hc6_a.setobslabel(10) Guatemala
gp_lac_hc6_a.setobslabel(11) Honduras
gp_lac_hc6_a.setobslabel(12) Mexico
gp_lac_hc6_a.setobslabel(13) Nicaragua
gp_lac_hc6_a.setobslabel(14) Panama
gp_lac_hc6_a.setobslabel(15) Paraguay
gp_lac_hc6_a.setobslabel(16) Peru
gp_lac_hc6_a.setobslabel(17) Uruguay
gp_lac_hc6_a.setobslabel(18) Venezuela


smpl 2010 2010
graph gp_lac_hc6_b.bar(contract=last, rotate) lac_arg_hc6 lac_bol_hc6 lac_bra_hc6 lac_cl_hc6 lac_col_hc6 lac_cr_hc6 lac_dr_hc6 lac_ec_hc6 lac_es_hc6 lac_ga_hc6 lac_ho_hc6 lac_mex_hc6 lac_nic_hc6 lac_pan_hc6 lac_par_hc6 lac_per_hc6 lac_ur_hc6 lac_vz_hc6
gp_lac_hc6_b.addtext(t, font(Calibri, 12, b)) Selected LAC Countries - Richness lines (Above 125% of median inc.) in 2010
gp_lac_hc6_b.setobslabel(1) Argentina
gp_lac_hc6_b.setobslabel(2) Bolivia
gp_lac_hc6_b.setobslabel(3) Brazil
gp_lac_hc6_b.setobslabel(4) Chile
gp_lac_hc6_b.setobslabel(5) Colombia
gp_lac_hc6_b.setobslabel(6) Costa-Rica
gp_lac_hc6_b.setobslabel(7) Dominican Rep.
gp_lac_hc6_b.setobslabel(8) Ecuador
gp_lac_hc6_b.setobslabel(9) El-Salvador
gp_lac_hc6_b.setobslabel(10) Guatemala
gp_lac_hc6_b.setobslabel(11) Honduras
gp_lac_hc6_b.setobslabel(12) Mexico
gp_lac_hc6_b.setobslabel(13) Nicaragua
gp_lac_hc6_b.setobslabel(14) Panama
gp_lac_hc6_b.setobslabel(15) Paraguay
gp_lac_hc6_b.setobslabel(16) Peru
gp_lac_hc6_b.setobslabel(17) Uruguay
gp_lac_hc6_b.setobslabel(18) Venezuela

freeze(gp_lac_hc6) gp_lac_hc6_a gp_lac_hc6_b

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Axis scaling

Postby EViews Jason » Wed Sep 02, 2015 10:25 am

try

Code: Select all

gp_lac_hc6_a.axis(l) range(0,100) gp_lac_hc6_b.axis(l) range(0,100)

catherinebrunet2
Posts: 5
Joined: Tue Sep 01, 2015 12:32 pm

Re: Axis scaling

Postby catherinebrunet2 » Wed Sep 02, 2015 2:56 pm

try

Code: Select all

gp_lac_hc6_a.axis(l) range(0,100) gp_lac_hc6_b.axis(l) range(0,100)
Thank you Jason, this works perfectly!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests