Data visualization using Gadfly
Gadfly is an exhaustive plotting and data visualization package written in Julia by Daniel Jones. It is based on the book, The Grammar of Graphics, by Leland Wilkinson. It is largely inspired by ggplot2
for R, which is another amazing package for plotting and visualizations.
Installing Gadfly
Installation is straightforward as it is a registered Julia package:
Julia> Pkg.update() Julia> Pkg.add("Gadfly")
This will also install a few other packages needed by Gadfly.
To use Gadfly, run this line:
Julia> using Gadfly
We will use IJulia (jupyter notebook) in our examples.
Gadfly has the capability to render high-quality graphics and visualizations in PNG, SVG, Postscript, and PDF. Embedded JavaScript is used by the SVG backend, which provides interactivity with the graphics such as zooming, panning, and toggling.
It is good to have Cairo installed, as it is needed by PNG, PostScript, and PDF:
Julia> Pkg.add("Cairo")
Suppose we create an exampleplot
. To...