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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 663 views
  • 1 like
  • 2 in conversation