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

Hi,

I would like to create a graph showing that my CO2flux_h and CO2flux_t response variables together. 
I tried to create it automatically by using "tasks- stack by" options but it did not work. 
Is there any code to create it? 

I am adding my data set as an attachment.

Thanks,


Suna 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Find your graph type here and the code is there too. 

 

http://robslink.com/SAS/democd7/aaaindex.htm

 

 

View solution in original post

6 REPLIES 6
Reeza
Super User

Find your graph type here and the code is there too. 

 

http://robslink.com/SAS/democd7/aaaindex.htm

 

 

smorkoc
Fluorite | Level 6

thank you!

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

thank you @Reeza for the link to Robs samples. Bookmarked for my future experiences. 

 

Reeza
Super User

Except you should learn SGPLOT. Most examples are SAS Graph, which is also what EG uses. SGPLOT is easier to use and better quality graphics, but there’s a lot of old SAS Graph code out there so it’s easier to find examples. 

 

Heres some SGPlot Examples. 

http://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html

smorkoc
Fluorite | Level 6

Hi I tried to use this code ;

 

goptions device=png;
goptions noborder;

goptions gunit=pct htitle=6 ftitle="albany amt/bold" htext=4.25 ftext="albany amt/bold";
goptions ctext=gray33;

axis1 label=('spacing') offset=(8,8);
axis2 label=(a=90 'CO2flux') order=(0 to 12 by 1) minor=(number=3) offset=(0,0);

pattern1 v=solid color=cx9999ff; /* light blue */
pattern2 v=solid color=cx993366; /* purplish */
pattern3 v=solid color=cxffffcc; /* pale yellow */

title1 ls=1.5 "Respiration";
title2 "Compares the contribution of Rh to Rt";
title3 "to a total across months";

proc gchart data=mydata.mt1;
vbar month / discrete type=mean sumvar=CO2flux nolegend
subgroup=flux_type
autoref clipref cref=graycc
maxis=axis1 raxis=axis2
coutline=black
width=8 space=3
des='' name="&name";
run;

 

but it just adds my flux_types which are Rh(heterotraphic respiration) and Rt( total respiration) together(it sums Rh and Rt,and results in graph). I meant I want to see Rh CO2flux inside of Rt CO2flux. How can I do this?

Reeza
Super User

I meant I want to see Rh CO2flux inside of Rt CO2flux. How can I do this?

 

No idea of what that means. Which of the graphs on that page were you trying to create, or what does that look like? and what does your data look like? If you need help with the code please provide sample data or use sashelp.cars in your attempt. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1282 views
  • 1 like
  • 3 in conversation