Data visualization with SAS programming

Errorbarattrs for groups

Reply
Occasional Contributor
Posts: 10

Errorbarattrs for groups

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.

Contributor
Posts: 42

Errorbarattrs for groups

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

Occasional Contributor
Posts: 10

Errorbarattrs for groups

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.

Post a Question
Discussion Stats
  • 2 replies
  • 464 views
  • 0 likes
  • 2 in conversation