BookmarkSubscribeRSS Feed
matt23
Quartz | Level 8

Hi. I'm running a multiple line plot with SGPLOT and I get 12 lines of basically the same color. All kinds of beiges or blues. Any way to make it have more vibrant colors?  Here's my code and styleattrs does not work for me.

proc sort data=dataname;
by Month hour;
run;

proc means data=dataname noprint;
by Month hour;
var Load temp dew win cc;
output out=Meanz mean=;
run;

proc print data=Meanz;
run;

proc sgplot data=Meanz;
series x=Hour y=Load / group=Month lineattrs=(thickness=2 pattern=solid);
xaxis values=(0 to 23 by 1);
run;
11 REPLIES 11
PaigeMiller
Diamond | Level 26

Something like this:

 

proc sgplot data=Meanz;
styleattrs datacontrastcolors=(red green blue cyan orange);
series x=Hour y=Load / group=Month lineattrs=(thickness=2 pattern=solid);
xaxis values=(0 to 23 by 1);
run;
--
Paige Miller
matt23
Quartz | Level 8
styleattrs does not work on my version of SAS. Any way around it ?
PaigeMiller
Diamond | Level 26

What version of SAS is that?


What is the ERROR message? Show us the relevant parts of the SASLOG.

--
Paige Miller
matt23
Quartz | Level 8
I'm using SAS EG 4.3 at the moment.

This is the error:
112 styleattrs datacontrastcolors=(red green blue cyan orange);
__________
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
PaigeMiller
Diamond | Level 26

Please show us the relevant parts of the SASLOG. This would be the SASLOG for the entire PROC SGPLOT code from start to end of PROC SGPLOT, including warnings and errors.

--
Paige Miller
Reeza
Super User

proc product_status;

run;

 

This will give you the SAS version. That’s a really, really old EG version as well. I think current one is 7.3

Reeza
Super User

Did the DataAttr map not work? If not, trying changing your overall style. Not sure what your destination is, but if it was PDF it would be like:

 

ods pdf file='path to file.pdf' <other options> style=seaside;

@matt23 wrote:
styleattrs does not work on my version of SAS. Any way around it ?

 

matt23
Quartz | Level 8

I'll just use gplot in this case. But can you help me make these lines thicker and delete the symbols?

 

symbol1 i = j value = W font = marker c = vivb h = 1 line = 1 width = 1;
symbol2 i = j value = W font = marker c = bigb h = 1 line = 1 width = 1; 
symbol3 i = j value = W font = marker c = liolbr h = 1 line = 1 width = 1;
symbol4 i = j value = W font = marker c = lilg h = 1 line = 1 width = 1; 
PaigeMiller
Diamond | Level 26

@matt23 wrote:

I'll just use gplot in this case. But can you help me make these lines thicker and delete the symbols?

 

symbol1 i = j value = W font = marker c = vivb h = 1 line = 1 width = 1;
symbol2 i = j value = W font = marker c = bigb h = 1 line = 1 width = 1; 
symbol3 i = j value = W font = marker c = liolbr h = 1 line = 1 width = 1;
symbol4 i = j value = W font = marker c = lilg h = 1 line = 1 width = 1; 

It seems relatively obvious how to make the lines thicker and delete the symbols. You ought to be able to figure this out yourself.

--
Paige Miller
Ksharp
Super User

data meanz;
set sashelp.air;
group=year(date);
run;
proc sgplot data=Meanz NOCYCLEATTRS;
series x=date y=air / group=group lineattrs=(thickness=2 pattern=solid);
run;

 

 

OR try:

 

ods graphics/ ATTRPRIORITY=color;

proc sgplot ............

Reeza
Super User

@Ksharp I think he's on SAS 9.2 which doesn't have a lot of the SGplot features.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 11 replies
  • 2622 views
  • 1 like
  • 4 in conversation