## Various scales on axes proc sgpanel (SAS 9.3)

Solved
Occasional Contributor
Posts: 6

# Various scales on axes proc sgpanel (SAS 9.3)

Hi,

I want to create a two-panel graph using proc sgpanel in SAS 9.3. The y-axis should be the same for the two panels, but I want one x-axis to be on a linear scale and the other on a logarithmic scale (expand). Can that be done in 9.3, or do you have any other way to create this type of graph?

Best regards,

Tommy

Accepted Solutions
Solution
‎03-09-2015 09:33 AM
Super Contributor
Posts: 261

## Re: Various scales on axes proc sgpanel (SAS 9.3)

Hi Tommy,

You can use GTL to do this, below is an example.

proc template;
define statgraph plot_linearlog;
begingraph;
layout lattice / rows = 1 columns = 2;

layout overlay / xaxisopts=(type = linear);
scatterplot x = Horsepower y = MPG_City;
endlayout;

layout overlay / xaxisopts=(type = log logopts = (tickintervalstyle = logexpand));
scatterplot x = Horsepower y = MPG_City;
endlayout;

endlayout;
endgraph;
end;
run;

proc sgrender data = sashelp.cars template = plot_linearlog;
run;

All Replies
Solution
‎03-09-2015 09:33 AM
Super Contributor
Posts: 261

## Re: Various scales on axes proc sgpanel (SAS 9.3)

Hi Tommy,

You can use GTL to do this, below is an example.

proc template;
define statgraph plot_linearlog;
begingraph;
layout lattice / rows = 1 columns = 2;

layout overlay / xaxisopts=(type = linear);
scatterplot x = Horsepower y = MPG_City;
endlayout;

layout overlay / xaxisopts=(type = log logopts = (tickintervalstyle = logexpand));
scatterplot x = Horsepower y = MPG_City;
endlayout;

endlayout;
endgraph;
end;
run;

proc sgrender data = sashelp.cars template = plot_linearlog;
run;

Occasional Contributor
Posts: 6

## Re: Various scales on axes proc sgpanel (SAS 9.3)

Thanks djrisks, you opened up a new world for me when introducing GLT. A little bit tricky to sort it all out, but I could create the graph exactly as I wanted.

Tommy

Super Contributor
Posts: 261