Visualizing Data hands-on workshop Nov 13, 2014 Instructor: Erika Mudrak | elm26@cornell.edu | @Erika Mudrak In General Take the graph as far as you can in your statistical software. Then export (or Save As) a: raster format – small file size, variable resolution (.png and .tif are the best, .jpg is common) vector format – large file size, no resolution issues (.emf or .wmf for PC, .svg for Macs) Edit in another graphics program: PowerPoint – Widely available and many already know how to use it Adobe Illustrator (advanced and $$) InkScape (advanced and free! https://inkscape.org/en/) Software-Specific Tips Stata Basic Graphics Overview http://www.stata.com/support/faqs/graphics/gph/stata-graphs/ http://www.ats.ucla.edu/STAT/stata/library/GraphExamples/default.htm Small Multiples http://www.stata.com/manuals13/g-2graphcombine.pdf Log-scale axes http://www.stata.com/manuals13/g-3axis_scale_options.pdf http://www.stata.com/support/faqs/graphics/box-plots-and-logarithmic-scales/ Contour Maps/HeatMaps http://www.stata.com/stata12/contour-plots/ Direct Labeling http://www.stata.com/manuals13/g-3marker_label_options.pdf Colors http://www.stata.com/manuals13/g-4colorstyle.pdf http://statadaily.ikonomiya.com/2010/09/23/color-palette/ JMP Basic Graphics Overview http://www.jmp.com/support/help/Graph_Builder.shtml#532017 http://www.jmp.com/support/help/Introduction_to_Interactive_Graphing.shtml#780063 http://www.jmp.com/support/help/Alter_Plot_and_Chart_Appearances.shtml Choose chart type along top. Use shift to overlay two chart types. Small Multiples Graph Builder: To make panels, drag a categorical variable into the “Group X” or “Group Y” box. Make a grid by dragging the variable into the “Wrap” box in the upper right corner. Log-scale axes Graph Builder: Right click on axis, Choose “Axis Settings.” Contour Maps/HeatMaps Standard Options along with other graph types Direct Labeling Graph Builder: Option appears on left for bar and pie charts. Unclear how to do more complicated labels Colors Right click on key to choose color, also option for transparency SPSS Basic Graphics Overview Chart Builder: http://www01.ibm.com/support/knowledgecenter/SSLVMB_22.0.0/com.ibm.spss.statistics.tut/spss/tutorials/bchar ttut_intro.htm Graphboard Template Chooser guides graph choice, but is harder to edit. Graphs Legacy dialogs if you know what you want to make Once graph is made in the output window, double click it to open the Chart Editor. Small Multiples https://andrewpwheeler.wordpress.com/tag/small-multiples/ Log-scale axes In Chart Editor, double click axis, choose scale tab, find the Scale pull-down menu and change from Linear to Logarithmic. Contour Maps/HeatMaps Not technically a heatmap, but a similar result: https://andrewpwheeler.wordpress.com/2012/06/17/visualization-techniques-for-large-n-scatterplotsin-spss/ Direct Labeling Haven’t found yet Colors In Chart Editor, double click on the element, choose tab “Fill & Border.” Get rgb and hsv values by double clicking on a color swatch. SAS Basic Graph Gallery: http://support.sas.com/sassamples/graphgallery/ Small Multiples http://sas-and-r.blogspot.com/2011/11/example-916-small-multiples.html http://support.sas.com/resources/papers/proceedings09/219-2009.pdf Log-scale axes http://support.sas.com/kb/25/505.html Contour Maps and HeatMaps http://support.sas.com/sassamples/graphgallery/PROC_GCONTOUR.html Direct Labeling https://support.sas.com/resources/papers/proceedings10/237-2010.pdf Colors http://blogs.sas.com/content/iml/2014/10/01/colors-for-heat-maps/ R Basic Graphics Overview http://www.statmethods.net/graphs/ http://shinyapps.stat.ubc.ca/r-graph-catalog/ Ggplot overview http://docs.ggplot2.org/current/ Small Multiples In base graphics: In general, use par(mfrow=c(nrow, ncols)) but be careful about margins (set with par(mar=c(x,x,x,x), oma=c(x,x,x,x), mgp=c(x,x,x)) More detail: http://seananderson.ca/courses/11-multipanel/multipanel.pdf In lattice: http://teachpress.environmentalinformatics-marburg.de/2013/06/producing-panel-plots-i-esmall-multiples-using-lattice-2/ Or use ggplot2 with facets http://gettinggeneticsdone.blogspot.com/2010/01/ggplot2-tutorialscatterplots-in-series.html Log-scale axes x=rnorm(1000,15,5) y=exp(x/10)+rnorm(1000,0,0.2) plot(x, y) plot(x, log(y)) plot(x,y,log="y") Contour Maps/HeatMaps http://support.sas.com/sassamples/graphgallery/PROC_GCONTOUR_Graph_Types_Plots_Contour.html http://blogs.sas.com/content/iml/2014/09/29/discrete-heat-maps/ Direct Labeling text(): http://www.statmethods.net/advgraphs/axes.html directlables package http://directlabels.r-forge.r-project.org/ http://kbroman.wordpress.com/2011/08/26/quick-labelswithin-figures-done-right/ Colors http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf RColorBrewer package functions: rgb() col2rgb() specifies according to rgb scale rainbow() gray() colorRamp() all give continuous color palletes