07-08-2016 11:10 AM - edited 07-08-2016 11:16 AM
I have created a MosaicPlot using the below code. Though, I would like to change the tile colors, say pink = light gray and blue = dark gray.
I can go into the images properties after copying it, but my options are horrific: black/white or gray/gray. Also I added the line of code that Rick suggested on another post but I still get the obligatory title on top (https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-a-graph-from-PROC-FREQ/m-p/226441/h...). Dropping that would be great. Also bolding labels and increasing font would be nice. Thank you.
PROC FORMAT; VALUE epab_1_fmt 1 = "Confident" 0 = "Not Confident"; VALUE time_fmt 1 = "0 Months" 2 = "3 Months" 3 = "6 Months" 4 = "12 Months"; RUN; ODS GRAPHICS ON; ods select MosaicPlot; title; /* clear the title */ %modtmplt(options=replace, template=Base.Freq.Graphics.MosaicPlot, steps=t); PROC FREQ DATA=EPA_rev; TABLE (epab_1)*time / TREND MEASURES CL PLOTS=MosaicPlot; LABEL epab_1 = "EPA 1"; TEST SMDRC; EXACT TREND / maxtime=60; FORMAT epab_1 epab_1_fmt.; Format time time_fmt.; RUN; ODS GRAPHICS OFF;
07-08-2016 11:27 AM
07-08-2016 11:52 AM - edited 07-08-2016 11:52 AM
Thank you. I will examine the link and update you all on my questions.
Though, I have entered the world of the ODS Graphics Editior! It seems like the right place, but perhaps it only augments the graph and won't let me manipulate its current content? Any feedback on how the Editor may help?
07-08-2016 12:13 PM
I just reviewed the webpage and this should definitly help (given that I can figure it out). I am gonna move on to something else until I have more time to come back to this and determine how to use all dark grays for epa_b = 1 and light gray for its complement.
Thanks and I will likely have follow-up questions early next week.
07-08-2016 12:38 PM
07-26-2016 02:56 PM
Below gets me closer to my desired output. I would like to increase the label's font size and attr marker (which are words) font size.
I am getting confused since I use layout region and most examples I see are layout overlay, and I don't know how to incoporate both.
proc sort data=epa_rev; by descending epab_13 time; run; proc freq data=epa_rev order=data; tables time*epab_13/ norow cellchi2 expected stdres crosslist; ods output CrossList=FreqList(where=(Expected>0)); run; /* color by response (notice that PROC FREQ reverses Y axis) */ proc template; define statgraph mosaicPlotParm; begingraph; layout region; MosaicPlotParm category=(time epab_13) count=Frequency / colorresponse=epab_13 name="mosaic" colormodel=twocoloraltramp; endlayout; endgraph; end; run; proc sgrender data=FreqList template=mosaicPlotParm; format time time_fmt.; FORMAT epab_13 epab_1_fmt.; LABEL epab_13 = ''; LABEL TIME = "Time (days)"; run;
P.S., I would prefer the colors to be black and white, but currently I can just save this output on the gray scale as a work around.
07-26-2016 03:20 PM - edited 07-26-2016 03:21 PM
Alright, I figured out the font question. Thought if anyone has an approach to make my binary outcome group gray and light gray on the graph I would be 1 step closer to the output I had been desiring.
proc template; define statgraph mosaicPlotParm; begingraph; layout region; MosaicPlotParm category=(time epab_13) count=Frequency / colorresponse=epab_13 name="mosaic" colormodel=twocoloraltramp labelattrs=(size=12pt) valueattrs=(size=12pt); endlayout; endgraph; end; run;