StatCrunch logo (home)

< StatCrunch Examples
Painting/annotating graphs
This example illustrates painting/annotating StatCrunch graphs. A bubble plot, which serves as a nice visualization of the impact of the 2009 swine flu outbreak on flu testing in the United States, will serve as the basis of this example. The steps required to create the bubble plot shown below are covered in the bubble plots example. This bubble plot is constructed using the Weekly influenza tests reported to the CDC from 1997 through 2014 data set. The data set contains CDC reports for the year, the week, the total number of specimens reported for that week, the number of the specimens that tested positive for the flu and the percentage of the specimens that tested positive for the flu. The bubble plot below allows for comparing the weekly reports for 2008 (the year before the outbreak) and 2009 (the year of the outbreak). The plot shows the percent of positive specimens versus week for both years with the points sized by the total number of specimens reported for that week.
About the bubble plot
The bubble plot below has a number of interesting details that show the impact of the outbreak. The 2008 data (shown in blue) represent a typical year of flu testing in the United States. In 2008, the percent of positive tests peaks over the winter months and declines over the summer months. The data for 2009 (shown in red) follows a similar pattern over the winter months, but there is a rapid increase in the percent of positive tests beginning in the spring of 2009 (week 17) corresponding to the original swine flu outbreak in the U.S. There is also another extreme rise in the percent of positive tests in the fall of 2009 (peaking in week 42) corresponding to the second wave of the outbreak. Comparing the size of the points in 2008 and 2009 also shows that the number of tests being conducted increased greatly over the period of the outbreak. The plot also shows a dramatic increase in the number of tests as the first wave of the epidemic began between weeks 16 and 17 of 2009. The data table in the screenshot below shows the number of tests to be 4,219 in week 16 of 2009 whereas the number of tests in week 17 of the same year increased by almost nine fold to 36,203. This is reflected in the plot by a point for week 17 of 2009 that is almost nine times larger than the point for week 16 of 2009. This example will cover the steps required to annotate this graph to highlight this rapid increase in testing.
Turning on the Paint option
A Paint option is available under the graph tools menu. As shown below, this menu is displayed as three lines in the bottom left corner of the graph on non-mobile devices. The menu is also displayed when a graph is tapped on a mobile device.
The Paint toolbar
When the Paint option is selected, a paint toolbar will appear within the graph as shown below. This toolbar contains an icon representing the selected drawing tool, an undo button, a close button and a draggable area that allows for repositioning the paint toolbar within the graph. The default drawing tool is the pen tool.
Selecting the arrow tool
To change the active drawing tool to the arrow tool, click on the drawing tool icon and edit the inputs as shown below. When the arrow tool is selected, the size and color associated with the tool can be modified. In the screenshot below, the size is set to 2 and the color is set to a shade of green to not interfere with the red color used to highlight inputs in StatCrunch examples. Click Okay to begin using the tool.
Using the arrow tool
To use the arrow tool, click and drag over the desired region. The arrow will be shown at the ending point of this action. In the screenshot below, two arrows have been added to emphasize the location of weeks 16 and 17 of 2009.
Selecting the text tool
To change the active drawing tool to the text tool, click on the drawing tool icon and edit the inputs as shown below. When the text tool is selected, the font, size and color of the tool can be modified. In the screenshot below, the size is set to 24. Click Okay to begin using the tool.
Using the text tool
To use the text tool, click to the left edge of the region where the text should appear. A cursor will be displayed indicating that text can be entered using the keyboard. In the screenshot below, the numbers of specimens tested in weeks 16 and 17 of 2009 have been associated with the respective arrows pointing to each week.

Always Learning