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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2145 views
  • 0 likes
  • 2 in conversation