<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/the-anatomy-of-a-useful-chart-noaas-flood-forecasts/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/01/the-anatomy-of-a-useful-chart.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>With thanks to <a target="_blank" rel="nofollow" href="http://www.water.weather.gov/ahps/">NOAA</a>'s incredible data gathering and forecasting activities, I've been obsessed with <a target="_blank" rel="nofollow" href="http://www.water.weather.gov/ahps2/hydrograph.php?wfo=mtr&gage=shec1&refresh=true">this chart</a> for the past few days:</p>
<p><a target="_blank" rel="nofollow" href="http://www.water.weather.gov/ahps2/hydrograph.php?wfo=mtr&gage=shec1&refresh=true"><img title="St helena" alt="St helena" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01bb09690fb0970d-800wi" border="0"></a></p>
<p>We used to live near the Napa river where this river gage is located, and still have many friends in the area. We were in the area last weekend, when a &quot;<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Pineapple_Express">pineapple express</a>&quot; weather event brought an atmospheric river over much of California, with much rain and <a target="_blank" rel="nofollow" href="http://www.latimes.com/local/lanow/la-me-ln-sierra-storm-20170108-story.html">some flooding in low-lying areas</a>. This was just before the first peak in the chart above, which shows the water level in the Napa river (in blue) along with a NOAA forecast (in purple). I was checking this chart obsessively, as the observed water level approached the &quot;Major Flood&quot; level, and experienced alternate bouts of hope and fear as the forecast skirted above the line from time to time.</p>
<p>Relying on this chart so intently made me appreciate what is takes to make a useful chart, so let's look at the ways this particular chart stands out. (While NOAA <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2012/04/noaa-r-river-flooding.html">does use R for some hydrological charts</a>, I don't think R was used for this one.)</p>
<p><strong>The chart is updated frequently, and the most recent data point is highlighted. </strong>New river levels were posted every 15 minutes, and at as the crest was peaking knowing how recent the data were was critical.</p>
<p><a target="_blank" rel="nofollow" href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8c629ba970b-pi"><img title="Flood stage" alt="Flood stage" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8c629ba970b-800wi" border="0"></a></p>
<p><strong>A forecast is provided</strong>. The purple dots are based on a hydrological forecast, which includes information from upstream gages, weather forecasts, and the river formation around this particular location.  This was an incredibly useful tool during the flood threat. However, the forecast is only updated every few hours, so having the recency of the forecast on the chart was incredibly helpful.</p>
<p><a target="_blank" rel="nofollow" href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8c62ab6970b-pi"><img title="Forecast" alt="Forecast" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8c62ab6970b-800wi" border="0"></a></p>
<p><strong>Context is provided for the measurements and forecast</strong>. I hadn't really paid much mind to the river level before — most of the time it's not much more than a minor stream. But knowing what river levels represented minor, moderate or major flooding (with their <a target="_blank" rel="nofollow" href="http://www.water.weather.gov/ahps2/pdf/hydrograph_terminology.pdf">detailed definitions</a>) was important. (As you can see, the river <em>just</em> avoided the major flooding stage on Sunday, and indeed the local town stayed mostly dry. <a target="_blank" rel="nofollow" href="https://twitter.com/JezebelMedia/status/818242537622077440">Some vineyards were flooded</a>, though)</p>
<p><strong>Time zones are provided with times</strong>. There's nothing more frustrating than looking at a date or time, not knowing what time zone the data are provided in. This chart includes both the local time zone (PST) for the main axis and annotations and, on the top axis, <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time#Time_zones">Coordinated Universal Time</a>. (17Z refers to 5PM Zulu time, which is 8 hours ahead of PST.)</p>
<p><strong>The second Y axis</strong>. Having a <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2016/08/dual-axis-time-series.html">second Y axis on a chart</a> is rarely a good idea, but this is one of the examples where it's useful. The river flow is directly (but nonlinearly) related to river height, so presenting it here on the Y axis is useful for those that need it. (This is actually the value — not river height — used as input to the forecasts.) But while bridge engineers care about river flow, most are more concerned about the height, which is given top billing on the main Y axis. Bonus credit: units are provided for both axes: always a must-have, but lamentably often forgotten.</p>
<p><strong>Annotations are provided for context</strong>. Having the recent and forecast peak heights and therecord flood height included on the chart provided context for the severity of the current flood threat, especially if you had experieced prior flood events in the area.</p>
<p><strong>The chart is in PNG format</strong>. That's a good choice for a chart like this: it's a lossless format, which means the data points appear in perfect fidelity. It's also a fairly compact format that keeps image sizes small — important for a website that may experience a lot of traffic from many people constantly refreshing the report. (Thoughtfully, an auto-refresh option was also provided.) JPG, a lossy format that blurs small data points and straight lines, would have been a terrible choice here.</p>
<p>That's not to say this chart gets everything right. More resolution would have been helpful (especially when trying to comare the last data point to the prior — is the river level rising or falling?). The color key for the flood stages is far from the chart on the webpage, rather than being included on the chart itself. The NOAA logo is a bit intrusive (though I understand why it's there). And in general the styling is could use an update (pseudo-3D chrome is <em>so</em> last century). But this chart gets many more things tahn it gets wrong, and provides a useful lesson in presenting data graphically that people can actually <em>use</em>.</p>
<p>As you can see from the chart, another flood-level crest is now heading down the river. As things stand now, it doesn't seem like it's going to be as severe as the one on Sunday, but to everyone in the affected areas: good luck, take care, and give thanks to NOAA for keeping us all informed. </p>
</div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/01/the-anatomy-of-a-useful-chart.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/jBjAAxqfGTM"></a></div>