BookmarkSubscribeRSS Feed
pdsaber
Calcite | Level 5

Hi

 

I want to create a square axis scatter plot with up to  60 legends , I am using proc template and Proc SGrender procedure.(which is kind of standard i have to follow) gplot is not allowed.

 

But the plot is rectangular most of the time. also i have two x y axes.

 

i have tried 

 

layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;
layout overlayequated /equatetype=square

xaxisopts=(griddisplay=off
label="" labelattrs=(family="arial" size=11pt weight=normal)
linearopts=(
viewmin=0.0 viewmax=&xmax_mg. minorticks=ON minortickcount=9
tickvaluesequence=( start=0.0 end=&xmax_mg. increment=&mg_incr.)))
yaxisopts=(
griddisplay=off
label="Glucose Result (mg/dL)" labelattrs=(family="arial" size=11pt weight=normal)
linearopts=(
viewmin=0.0 viewmax=&ymax_mg. minorticks=ON minortickcount=9
tickvaluesequence=( start=0.0 end=&ymax_mg. increment=&mg_incr.)))
x2axisopts=(
label="" labelattrs=(family="arial" size=11pt weight=normal)
linearopts=(
viewmin=0.0 viewmax=%sysevalf(&xmax_mg. / 18.016) minorticks=ON minortickcount=4
tickvaluesequence=( start=0.0 end=&xmax_mm. increment=&mm_incr.)))
y2axisopts=(
label="Glucose Result (mmol/L)" labelattrs=(family="arial" size=11pt weight=normal)
linearopts=(
viewmin=0.0 viewmax=%sysevalf(&ymax_mg. / 18.016) minorticks=ON minortickcount=4
tickvaluesequence=( start=0.0 end=&ymax_mm. increment=&mm_incr.)))
;
scatterplot x= &x_var_mg. y= &y_var_mg. / group=&group. name='scatter';
scatterplot x= &x_var_mg. y= &y_var_mm. / name='scatter2' yaxis=y2 datatransparency=1;
scatterplot x= &x_var_mm. y= &y_var_mg. / name='scatter3' xaxis=x2 datatransparency=1;
annotate;
endlayout;
sidebar / align=bottom spacefill=false;
discretelegend 'scatter' / opaque=true border=false halign=center valign=center displayclipped=true order=rowmajor across=2
title='' titleattrs=(family="arial" size=10pt weight=bold);
endsidebar;
endlayout;
endgraph;
end;
run;quit;

 

but this doesn't work.

2 REPLIES 2
PeterClemmensen
Super User

Why on earth would want 60 legends in a plot?

ballardw
Super User

You probably should share your current ODS Graphics settings as you are likely to have a lot of interaction between your graph settings and the display. You may need to adjust the ODS Graphics Height and Width options, likely the Scale option and maybe Legendareamax.

 

You can use the ODS Graphics option SHOW to have your current settings appear in the log if you don't know what they are.

 

 

Example data, including values of any macro variables, with complete code for the template and Sgrender call are needed for us to test anything. You could use a SAS supplied data set to demonstrate or provide an example of your data. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 238 views
  • 0 likes
  • 3 in conversation