BookmarkSubscribeRSS Feed
unnati
Obsidian | Level 7

Hello,sgplot.PNG

In my graph, I am trying to align my "GCSF use" symbol correctly on its associate cycles. 

For example first triangle for "GCSF use" suppose to be on tickvalue of "Cycle 03 Day1" . second one should be on "Cycle 6 Day 1" , Third one should be in between "Cycle 6 Day 1" and "Cycle 7 Day 1"  and last one should be on "Cycle 8 Day 15".

I tried changing offsetmin and offsetmax for X2axispots but no luck. Can anyone help me to resolve this issue.

proc Template;
	define statgraph Product1;
		mvar PLAT AMRLINES BMBPA LPIMID subjid;
       dynamic var;
		BeginGraph /designwidth=800 designheight=400px;
		entrytitle " ANC graph for subjid=" var;
			layout lattice / rows=1 columns=1 columnDataRange=unionall;
				layout overlay /

					yaxisopts=(griddisplay=off label="Absolute Neutrophil Count (10^9/L)" ) 
					xaxisopts=(griddisplay=off display=(ticks tickvalues label) label='VISIT' offsetmin=.05 offsetmax=.05 
					linearopts=(viewmin=0 viewmax=81 ))
					x2axisopts=(griddisplay=off display= none  offsetmin=.05 offsetmax=.05 
					linearopts=(viewmin=0 viewmax=81 ));
					seriesplot y=aval x=avisit / DATALABEL=chg lineattrs=(thickness=2.5 color=black  PATTERN=1) name="STEP";
					
					scatterplot y=aval x=avisit /  markerattrs=(size=8 color=CXFF8C00 symbol=circlefilled transparency = .05) name='b' legendlabel='ANC Value';
					scatterplot y=aval2 x=avisit_1 / markerattrs=(size=8 color=CXFF1493 symbol=trianglefilled transparency = .05) legendlabel='GCSF Use' datalabel=name name='a' xaxis=x2;
					scatterplot y=aval3 x=visit / DATALABEL=exdose  markerattrs=(size=8 color=green symbol=squarefilled transparency = .05) legendlabel='Dose Reduction' datalabel=name name='c' ;
discretelegend 'a' 'c' 'b'/ location=outside halign=right across=1;
					layout gridded / opaque=true backgroundcolor=CXECECEC border=false rows=4 columns=2 border=false autoalign=(topright topleft bottomright bottomleft);

						/*- Line 1-2 -*/
						entry halign=left "Baseline Platelet count";
						entry halign=left PLAT;
						entry halign=left "Number Prior lines";
						entry halign=left AMRLINES;

						/*- Line 3-4 -*/
						entry halign=left " % Plasma cell";
						entry halign=left BMBPA;
						entry halign=left "Last Regimen ImiDs";
						entry halign=right LPIMID;
					endlayout;
				endlayout;
			endlayout;
		EndGraph;
	end;
run;


options orientation=landscape nodate nonumber;
ods graphics on / 
      width     = 27.0cm
      height    = 14.3cm
      imagefmt  = png
      imagemap  = on
      border    = off;
ods listing close;                                                                                                                      
ods pdf 

        file    = "path./&prgm..pdf"  ;
/*        nogtitle  */
/*        nobodytitle */
/*        style   = pdfstyleSF;*/
proc sgrender data=final  template=Product1;
run;
ods pdf close;
ods listing;
ods graphics off;

Thank you,

Unnati

1 REPLY 1
ballardw
Super User

debugging positions of specific values locations on a graph with out the actual data set is next to impossible.

It is even harder when you don't even mention what the name of the variable is. Since you have 3 x and 3 y variables then it is a total guess as to even which lines of code to examine.

 

I can't even tell if your X variables are numeric or not. Since character values are not typically going to have a native "space" between values this gets pretty important at well.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1051 views
  • 3 likes
  • 2 in conversation