01-30-2017 08:27 AM - edited 01-30-2017 09:26 AM
Happy Monday! I always find it funny how things happen in clusters - I've had 3 separate conversations this weekend where the theme was bad data visualisation. I also read a number of student papers this weekend and some were absolutely stellar, and others...weren't. I know we all "know" the rules of data viz, but I thought it would be an interesting excercise to see what bad data graphics people could come up with in SAS (whether it's EG, EM, etc. - the more variety the better!), using SAS Datasets. My plan is to use these examples as part of future talks I give to students; sort of a "What do you see wrong with this?" excercise. Thanks in advance and I look forward to seeing what you come up with!
I present to you my submission:
proc template; define statgraph sgdesign; dynamic _WEIGHT _HORSEPOWER _MPG_HIGHWAY; begingraph / designwidth=715 designheight=546; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10; layout overlay; scatterplot x=_HORSEPOWER y=_WEIGHT / group=_MPG_HIGHWAY name='scatter'; discretelegend 'scatter' / opaque=false border=true halign=right
valign=bottom displayclipped=true across=1 order=rowmajor location=inside; endlayout; endlayout; endgraph; end; run; proc sgrender data=SASHELP.CARS template=sgdesign; dynamic _WEIGHT="WEIGHT" _HORSEPOWER="HORSEPOWER" _MPG_HIGHWAY="'MPG_HIGHWAY'n"; run;
01-30-2017 09:52 AM - edited 01-30-2017 09:53 AM
Bad visualizations are one thing, but could you submit reasonable SAS code that generates the graph? Or is poorly written SAS code part of the challenge?
In this case, there is no need to use data-specific names for the dynamic variables in the template. Use
dynamic _X _Y _GROUP;
and set the values appropriately in PROC SGRENDER.
01-30-2017 09:56 AM
Hey @Rick_SAS - good point; I must admit I used ODS Graphics Designer to generate the graph, and then took the (unmodified) code from it to use in my post. I should have mentioned that and thanks for the reply.
01-30-2017 02:50 PM