In this chapter, we will cover the following recipes:
Graphs serve a couple of important functions in data analysis. First, when exploring data, they can help us understand our data and the relationships in it.
But data analysis isn't all about wrangling data and crunching numbers. We must also communicate our findings and convey evidence for our arguments. Graphs serve an important role in succinctly communicating complex relationships. Although graphs can be unclear, confusing, or not too informative, well-made graphs can clarify concepts and relationships that are difficult to explain verbally.
Designing good, informative, and beautiful charts is difficult, and if you want to dive into that topic, and there's a lot of good information out there. Anything by Edward Tufte (http://www.edwardtufte.com/tufte/) is an excellent place to start, and his book, The Visual Display of Quantitative Information, is considered a classic in the field of data visualization design. To create charts and graphs, there are a number of options. There are a lot of solutions for graphing. In the next chapter, we'll look at some solutions involving ClojureScript (https://github.com/clojure/clojurescript) and d3 (http://d3js.org/). We also have R (http://www.r-project.org/), especially with its ggplot2 library (http://ggplot2.org/), and Mathematica (http://www.wolfram.com/mathematica/), which we worked with in Chapter 8, Working with Mathematica and R, both of which have strong graphing libraries.
In this chapter, we'll focus on Incanter charts. They are built on the JFreeChart library (http://www.jfree.org/jfreechart/), which provides a powerful set of functions to graph data. In this chapter, we'll use them to create a variety of types of graphs. We'll also look at how to save graphs as PNG images. We'll use principal component analysis (PCA) to project multidimensional data down to two dimensions so that they can be graphed easily. Finally, we'll create an interactive, dynamic graph.