BookmarkSubscribeRSS Feed
mccauskl
Calcite | Level 5

We have created a panel bar graph with lines representing benchmark values.  We used a keylegend statement to define the line portions of the figures, but the lines are too faint to visually discern the colors or patterns easily. I suspect it is an issue of the legend's transparency so I tried to implement the opaque option but received an error.  Is the opaque option available in SAS 9.4?  If the opaque option is not available to me, does anyone have any suggestions for changing the line thickness in the legend? 

 

Here is an excerpt of the code from the proc sgpanel:

 

keylegend "Norm" "Sample Mean" / down = 1 

     titleattrs=(color = black size = 10) 

           noborder position = top opaque;

 

 

 

 Here is the language from the error message:

 

ERROR 22-322: Syntax error, expecting one of the following: ;, ACROSS, AUTOITEMSIZE, AUTOOUTLINE, BORDER, DOWN, EXCLUDE, FILLASPECT, FILLHEIGHT, LINELENGTH, NOBORDER, OUTERPAD, POSITION, SCALE, SORTORDER, TITLE, TITLEATTRS, TYPE, VALUEATTRS.

 

ERROR 202-322: The option or parameter is not recognized and will be ignored.

 

 

4 REPLIES 4
Reeza
Super User

Opaque is a valid option in SAS 9.4 for SGPLOT, but not for SGPANEL according to the documentation. 

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=n1txerz2g23a70n1kqo75gs8srla.htm&docs...

 

 

mccauskl
Calcite | Level 5

Thanks!  Do you have a suggestion for an alternative within SGPANEL that would make the legend readable? 

Reeza
Super User

No, if you provide a reproducible sample, ie make your code work with a SASHELP data set, I'm happy to look into it but it's hard to do without data or code. Hopefully someone else in this forum, (the SAS staff hopefully) will have a response soon. If not, I'll tag them eventually 😄

 

ballardw
Super User

@mccauskl wrote:

Thanks!  Do you have a suggestion for an alternative within SGPANEL that would make the legend readable? 


As a minimum show the entire Proc SGPanel code you are currently using.

 

If you are setting attributes in the plot that are transparent then you are going to have issues as the legend attempts to replicate those.

Reduce transparency settings if you are using them.

Make the displayed elements a bit larger perhaps, line width or marker size.

Use an ANNOTATE data to create a legend from scratch.

Perhaps use SGPLOT with one or more BY variables.

 

Move the Graphic template language where there may be more controls with a Layout Lattice that Sgpanel does not honor.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 4 replies
  • 1251 views
  • 0 likes
  • 3 in conversation