BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ykoba
Fluorite | Level 6

SGRender (62).pngI am writing the following code and get the attached result.

 

proc template;
define statgraph regress;
begingraph;
entrytitle 'Ngal';
layout overlay;
barchart x=group y=ngal/stat=mean group=group display=(fillpattern fill outline)
grouporder=data;
scatterplot x=group y=ngal /group=group
yerrorlower=lower_ngal yerrorupper=upper_ngal
markerattrs=(size=10)
errorbarattrs=(thickness=3 pattern=dot color=black);
endlayout;
endgraph;
end;


define style styles.mypatterns;
parent=styles.listing;
style GraphData1 from GraphData1 /
fillpattern = "e1"
color=white
contrastcolor=white
markersymbol='circle';
style GraphData2 from GraphData2 /
fillpattern = "R1"
color=white
contrastcolor=black
markersymbol='circle';
style GraphData3 from GraphData3 /
fillpattern = "e1"
color=black
contrastcolor=black
markersymbol='circle';
style GraphData4 from GraphData4 /
fillpattern = "L1"
color=white
contrastcolor=black
markersymbol='circle';
end;
run;

ods html style=mypatterns;
ods graphics / reset border width=600px height=400px;

proc sgrender data=work.data template=regress;
run;

 

I would like to delete the dot lines along with error bars. I have been spending more than a few weeks with this. Actually, I don't understand why this code draws the dot lines beyond the error bar range.

Any suggestions or advice will be welcomed.

Thank you in advance for your help.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

1. Provide some test data so we can reproduce

2. Format your text by using the appropriate icons to paste the code ( </> for log, running man for code) 

3. Use the image icon to add images, not a file attachment.

Thank you 🙂

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

1. Provide some test data so we can reproduce

2. Format your text by using the appropriate icons to paste the code ( </> for log, running man for code) 

3. Use the image icon to add images, not a file attachment.

Thank you 🙂

ballardw
Super User

@ykoba wrote:

SGRender (62).pngI am writing the following code and get the attached result.

 

proc template;
define statgraph regress;
begingraph;
entrytitle 'Ngal';
layout overlay;
barchart x=group y=ngal/stat=mean group=group display=(fillpattern fill outline)
grouporder=data;
scatterplot x=group y=ngal /group=group
yerrorlower=lower_ngal yerrorupper=upper_ngal
markerattrs=(size=10)
errorbarattrs=(thickness=3 pattern=dot color=black);
endlayout;
endgraph;
end;


define style styles.mypatterns;
parent=styles.listing;
style GraphData1 from GraphData1 /
fillpattern = "e1"
color=white
contrastcolor=white
markersymbol='circle';
style GraphData2 from GraphData2 /
fillpattern = "R1"
color=white
contrastcolor=black
markersymbol='circle';
style GraphData3 from GraphData3 /
fillpattern = "e1"
color=black
contrastcolor=black
markersymbol='circle';
style GraphData4 from GraphData4 /
fillpattern = "L1"
color=white
contrastcolor=black
markersymbol='circle';
end;
run;

ods html style=mypatterns;
ods graphics / reset border width=600px height=400px;

proc sgrender data=work.data template=regress;
run;

 

I would like to delete the dot lines along with error bars. I have been spending more than a few weeks with this. Actually, I don't understand why this code draws the dot lines beyond the error bar range.

Any suggestions or advice will be welcomed.

Thank you in advance for your help.

 


I am not clear what you actually mean by "delete the dot lines along with the error bars".

Just the dots or the entire bar???

 

If you want to indicate the upper and lower values that are stored in your lower_ngal and upper_ngal variables but not as error bars then you could overlay two more scatter plots with the x=group and y=lower_ngal picking a different sort of marker. Or maybe a highlow plot if want just to connect the the lower an upper values.

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 678 views
  • 2 likes
  • 3 in conversation