Data visualization with SAS programming

proc sgpanel legend seems to be transparent -- lines are too faint to see clearly

Reply
New Contributor
Posts: 2

proc sgpanel legend seems to be transparent -- lines are too faint to see clearly

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.

 

 

Super User
Posts: 24,010

Re: proc sgpanel legend seems to be transparent -- lines are too faint to see clearly

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...

 

 

New Contributor
Posts: 2

Re: proc sgpanel legend seems to be transparent -- lines are too faint to see clearly

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

Super User
Posts: 24,010

Re: proc sgpanel legend seems to be transparent -- lines are too faint to see clearly

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 Smiley Very Happy

 

Super User
Posts: 13,941

Re: proc sgpanel legend seems to be transparent -- lines are too faint to see clearly


@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.

Ask a Question
Discussion stats
  • 4 replies
  • 131 views
  • 0 likes
  • 3 in conversation