BookmarkSubscribeRSS Feed
huangchiuhua19
Calcite | Level 5

What can I do so that M is a blue dashed line, F is a red dashed line, and N is a solid black line?
In addition, how to set the style of the line?
Thank you very much for everyone’s helpful replies.

Here is my code and a picture of the result.

 

proc sgplot data=a;
title "Figure 3";
vline pro / response=rt stat=mean markers
group=vio lineattrs=(thickness=4px);
run;

huangchiuhua19_0-1694237966845.png

 

1 REPLY 1
DanH_sas
SAS Super FREQ

Use a Discrete Attributes Map:

 

data map;
retain id "my_id";
length linepattern $ 10;
input value $ linecolor $ linepattern $;
cards;
F red   mediumdash
M blue  shortdash
N black solid
;
run;

data class;
set sashelp.class;
if age > 14 then sex="N";
run;

proc sgplot data=class dattrmap=map;
series x=age y=weight/group=sex attrid=my_id;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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