BookmarkSubscribeRSS Feed
ahappel
Calcite | Level 5

So I feel I have spent enough time trying to figure this out with my limited coding knowledge that it is time to come to the experts.

I am producing a graph using the following codeing

proc sgplot data=end;

scatter y=Nmean x=Cmean/ group=spp

yERRORLOWER=Nlow yERRORUPPER=NHigh

xERRORLOWER=CLow xERRORUPPER=CHigh

DATALABEL=site;

run;

It works all fine and dandy for a presentation, however for publication things will be in black and white.  I would like to know how to make the error bars for one group dashed while keeping the other solid.  This is done in 9.2 if you decide to try changing styles/templates (something i've been playing with to no avail).

Thanks for the help on this, I know its probably easier than most issues here.

2 REPLIES 2
jcbell
Obsidian | Level 7

Have you tried using a data attribute map?  This will allow you to change the color of the lines based on the value of the grouping variable. 

Try this link:

http://support.sas.com/documentation/cdl/en/grstatproc/64778/HTML/default/viewer.htm#n18szqcwir8q2nn...

Thanks,

john

ahappel
Calcite | Level 5

For somereason I cant get the program to recognize attribute mapping the way that shows me.

The closest I have come to what I desire is using this:

proc template ;

  define statgraph group;

    begingraph;

      entrytitle "N vs C";

       layout overlay;

        scatterplot x=Cmean y=Nmean  / group=spp yERRORLOWER=Nlow yERRORUPPER=NHigh

xERRORLOWER=CLow xERRORUPPER=CHigh

errorbarattrs=graphdata1(pattern=dot)

errorbarattrs=graphdata2(pattern=Solid)

errorbarattrs=graphdata3(pattern=Dash)

DATALABEL=site;;

Discretelegend "spp";

endlayout;

    endgraph;

  end;

run;

proc template;

  define style biplots;

    parent=styles.journal;

    style GraphData1 /

      ContrastColor=red

      MarkerSymbol="CircleFilled";     

    style GraphData2 /

      ContrastColor=blue

      MarkerSymbol="TriangleFilled";

    style GraphData3 /

      ContrastColor=green

      MarkerSymbol="SquareFilled";     

  end;

run;

ods listing style=biplots;

proc sgrender data=end

          template=group;run;

The Problem is that the errorbarattrs override each other and I cant figure out how to get it to acknowledge all of them.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2 replies
  • 2652 views
  • 0 likes
  • 2 in conversation