Data visualization with SAS programming

How to change marker size in style template

Reply
Occasional Contributor
Posts: 13

How to change marker size in style template

I know we can change marker size in the template using markerattrs=(size=10px).
I tried to do that in style (markersize = 10px) but it seems do not work. Is there a way to set maker size in style?

Thanks,
Yeming

Here is the program:

proc template;
define style Styles.MyJournal;
parent = styles.Journal;
style GraphData1 from GraphData1 /
markersize = 10px
markersymbol = "CircleFilled";
style GraphData2 from GraphData2 /
markersize = 10px
markersymbol = "plus";
style GraphData3 from GraphData3 /
markersize = 10px
markersymbol = "X";
style GraphData4 from GraphData4 /
markersymbol = "triangle";
style GraphData5 from GraphData5 /
markersymbol = "tilde";
style GraphData6 from GraphData6 /
markersymbol = "ibeam";
style GraphData7 from GraphData7 /
markersymbol = "square";
style GraphData8 from GraphData8 /
markersymbol = "asterisk";
style GraphData9 from GraphData9 /
markersymbol = "diamond";
style GraphData10 from GraphData10 /
markersymbol = "union";
style GraphData11 from GraphData11 /
markersymbol = "hash";
style GraphData12 from GraphData12 /
markersymbol = "tack";
run;

proc format;
value vf 5 = 'GraphValueText';
run;

data x;
array y[20] y0 - y19;
do x = 1 to 20; y = x - 0.5; end;
do x = 0 to 10 by 5; output; end;
label y0 = 'GraphLabelText' x = 'GraphLabelText';
format x y0 vf.;
run;

%macro l(i, l);
reg y=y&i x=x / lineattrs=&l markerattrs=&l curvelabel=" &l"
curvelabelpos=max;
%mend;

ods listing style=myjournal;
proc sgplot noautolegend;
title 'GraphTitleText';
%macro d; %do i = 1 %to 12;
reg y=y%eval(19-&i) x=x / lineattrs=GraphData&i markerattrs=GraphData&i
curvelabel=" GraphData&i" curvelabelpos=max;
%end; %mend; %d
%l(19, GraphDataDefault)
%l( 6, GraphFit)
%l( 5, GraphFit2)
%l( 4, GraphPredictionLimits)
%l( 3, GraphConfidence)
%l( 2, GraphGridLines)
%l( 1, GraphOutlier)
%l( 0, GraphReference)
xaxis values=(0 5 10);
run;
SAS Super FREQ
Posts: 1,080

Re: How to change marker size in style template

MarkerSize changes from GraphData1-N are not supported.

A work around for some cases (where number of groups is known) is to transpose your data into columns, and use a separate scatter statement for each column with MARKERATTRS=(SIZE=15) in the syntax.

If it is important that groups support marker size, please call it in to SAS Tech Support.
Occasional Contributor
Posts: 13

Re: How to change marker size in style template

Hi Sanjay,

Thanks.
Yeming
Ask a Question
Discussion stats
  • 2 replies
  • 726 views
  • 3 likes
  • 2 in conversation