BookmarkSubscribeRSS Feed
A_Kh
Barite | Level 11

Hello Community, 

While creating matrix plot using the option DIOGANAL=(histogram), tick values are disappearing . Trying to use GTL to modify the template, but don't see any available options in the tmplout-generated code or sas documentations. TEMPLATES with/out tick values don't differ. 
Is there any SG or GTL option available for the MATRIX statement to display tick values even when using DIOGANAL=(histogram) option? 

Please see the below examples.  

1. Tick values displayed without DIOGANAL=(histogram) option. 

proc sgscatter data=sashelp.iris tmplout='C:\Users\Desktop\matrix1.sas';
  title "Scatterplot Matrix for Iris Data";
  matrix sepallength petallength;
run;
title;

the tmplout created template is:

proc template;
define statgraph sgscatter;
begingraph / designwidth=640 designheight=640;
EntryTitle "Scatterplot Matrix for Iris Data" /;
layout lattice / pad=(top=5);
    ScatterPlotMatrix SepalLength PetalLength / subpixel=off NAME="MATRIX";
endlayout;
endgraph;
end;
run;


2. Tick values disappeared with DIOGANAL=(histogram) option. 

proc sgscatter data=sashelp.iris tmplout='C:\Users\Desktop\matrix2.sas';
  title "Scatterplot Matrix for Iris Data";
  matrix sepallength petallength/diagonal=(histogram);
run;
title;

the tmplout created template is:

proc template;
define statgraph sgscatter;
begingraph / designwidth=640 designheight=640 subpixel=on;
EntryTitle "Scatterplot Matrix for Iris Data" /;
layout lattice / pad=(top=5);
    ScatterPlotMatrix SepalLength PetalLength / subpixel=off NAME="MATRIX" diagonal=( histogram );
endlayout;
endgraph;
end;
run;




1 REPLY 1
DanH_sas
SAS Super FREQ

Unfortunately, there is not a good way to achieve what you requested. The histograms have different axis ranges from the scatter plots, so the unified external row/column axes around the matrix cannot be created without negatively impacting the visual. The best you could do would be to create a Layout Lattice in GTL and, using internal axes, add the scatter plots and histograms in the desired order.

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 75 views
  • 1 like
  • 2 in conversation