BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hellohere
Pyrite | Level 9

I have a time-series dataset[time=i; Y=tsvar], attached.

I need have multiple reference at column=refind,

AND if refcolor=max, color=lime, if refcolor=min, color=blue. 

 

Thanks, 

 

 

sc.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
libname x v9 'C:\Users\xiakeshan\Documents\Downloads';

data have;
 set x._test;
 if refcolor='max' then max=refind;
 if refcolor='min' then min=refind;
run;
proc sgplot data=have ; *dattrmap=mymap; 
series x=i y=tsvar /lineattrs=(color=red thickness=2 pattern=solid); 
refline max/axis=x lineattrs=(thickness=2 pattern=solid color=lime) ; 
refline min/axis=x lineattrs=(thickness=2 pattern=solid color=blue) ; 
run;

Ksharp_0-1759753631714.png

 

View solution in original post

5 REPLIES 5
hellohere
Pyrite | Level 9
proc sgplot data=_test dattrmap=mymap; series x=i y=tsvar /lineattrs=(color=red thickness=2 pattern=solid); refline refind/axis=x lineattrs=(thickness=2 pattern=solid); run;quit; Wanted: the refline for max and min shows up with diff color. Here only one color.
PaigeMiller
Diamond | Level 26

I think we need to see the code that creates data set MYMAP. Please post code in the proper code box (it has the little running man icon) as you did in earlier threads.

--
Paige Miller
Ksharp
Super User
libname x v9 'C:\Users\xiakeshan\Documents\Downloads';

data have;
 set x._test;
 if refcolor='max' then max=refind;
 if refcolor='min' then min=refind;
run;
proc sgplot data=have ; *dattrmap=mymap; 
series x=i y=tsvar /lineattrs=(color=red thickness=2 pattern=solid); 
refline max/axis=x lineattrs=(thickness=2 pattern=solid color=lime) ; 
refline min/axis=x lineattrs=(thickness=2 pattern=solid color=blue) ; 
run;

Ksharp_0-1759753631714.png

 

hellohere
Pyrite | Level 9
Thanks. Nice skip around.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 164 views
  • 1 like
  • 4 in conversation