This notebook provides a few examples of the shared graphing utilities within AWASH.

Graphing functions are provided in forms that use either R or native Julia Plots commands. If RCall is installed, then loading graphing.jl will load the R versions; otherwise, the Plots versions will be used.

Below we will use the constituent graphing-rcall.jl and graphing-native.jl libraries separately, to show how each looks.


In [4]:
using DataFrames
counties = readtable("../data/global/counties.csv")
counties[:value] = counties[:state];

In [16]:
include("../src/lib/graphing-native.jl")


Out[16]:
usmap (generic function with 2 methods)

In [18]:
usmap(counties)


Out[18]:
x -1×10⁷ -9×10⁶ -8×10⁶ -7×10⁶ -6×10⁶ -5×10⁶ -4×10⁶ -3×10⁶ -2×10⁶ -1×10⁶ 0 1×10⁶ 2×10⁶ 3×10⁶ 4×10⁶ 5×10⁶ 6×10⁶ 7×10⁶ 8×10⁶ 9×10⁶ 1×10⁷ -9.0×10⁶ -8.8×10⁶ -8.6×10⁶ -8.4×10⁶ -8.2×10⁶ -8.0×10⁶ -7.8×10⁶ -7.6×10⁶ -7.4×10⁶ -7.2×10⁶ -7.0×10⁶ -6.8×10⁶ -6.6×10⁶ -6.4×10⁶ -6.2×10⁶ -6.0×10⁶ -5.8×10⁶ -5.6×10⁶ -5.4×10⁶ -5.2×10⁶ -5.0×10⁶ -4.8×10⁶ -4.6×10⁶ -4.4×10⁶ -4.2×10⁶ -4.0×10⁶ -3.8×10⁶ -3.6×10⁶ -3.4×10⁶ -3.2×10⁶ -3.0×10⁶ -2.8×10⁶ -2.6×10⁶ -2.4×10⁶ -2.2×10⁶ -2.0×10⁶ -1.8×10⁶ -1.6×10⁶ -1.4×10⁶ -1.2×10⁶ -1.0×10⁶ -8.0×10⁵ -6.0×10⁵ -4.0×10⁵ -2.0×10⁵ 0 2.0×10⁵ 4.0×10⁵ 6.0×10⁵ 8.0×10⁵ 1.0×10⁶ 1.2×10⁶ 1.4×10⁶ 1.6×10⁶ 1.8×10⁶ 2.0×10⁶ 2.2×10⁶ 2.4×10⁶ 2.6×10⁶ 2.8×10⁶ 3.0×10⁶ 3.2×10⁶ 3.4×10⁶ 3.6×10⁶ 3.8×10⁶ 4.0×10⁶ 4.2×10⁶ 4.4×10⁶ 4.6×10⁶ 4.8×10⁶ 5.0×10⁶ 5.2×10⁶ 5.4×10⁶ 5.6×10⁶ 5.8×10⁶ 6.0×10⁶ 6.2×10⁶ 6.4×10⁶ 6.6×10⁶ 6.8×10⁶ 7.0×10⁶ 7.2×10⁶ 7.4×10⁶ 7.6×10⁶ 7.8×10⁶ 8.0×10⁶ 8.2×10⁶ 8.4×10⁶ 8.6×10⁶ 8.8×10⁶ 9.0×10⁶ -1×10⁷ -5×10⁶ 0 5×10⁶ 1×10⁷ -9.0×10⁶ -8.5×10⁶ -8.0×10⁶ -7.5×10⁶ -7.0×10⁶ -6.5×10⁶ -6.0×10⁶ -5.5×10⁶ -5.0×10⁶ -4.5×10⁶ -4.0×10⁶ -3.5×10⁶ -3.0×10⁶ -2.5×10⁶ -2.0×10⁶ -1.5×10⁶ -1.0×10⁶ -5.0×10⁵ 0 5.0×10⁵ 1.0×10⁶ 1.5×10⁶ 2.0×10⁶ 2.5×10⁶ 3.0×10⁶ 3.5×10⁶ 4.0×10⁶ 4.5×10⁶ 5.0×10⁶ 5.5×10⁶ 6.0×10⁶ 6.5×10⁶ 7.0×10⁶ 7.5×10⁶ 8.0×10⁶ 8.5×10⁶ 9.0×10⁶ KY SC FL IN CO AZ WY ID NH RI OR MD ME DE DC VT VA CT MO GA NV MN WA AL ND NM UT IA NE TN AR CA KS OH NC MI MT NJ MS OK WV IL TX LA PA WI MA SD NY Color -7×10⁶ -6×10⁶ -5×10⁶ -4×10⁶ -3×10⁶ -2×10⁶ -1×10⁶ 0 1×10⁶ 2×10⁶ 3×10⁶ 4×10⁶ 5×10⁶ 6×10⁶ 7×10⁶ -6.0×10⁶ -5.8×10⁶ -5.6×10⁶ -5.4×10⁶ -5.2×10⁶ -5.0×10⁶ -4.8×10⁶ -4.6×10⁶ -4.4×10⁶ -4.2×10⁶ -4.0×10⁶ -3.8×10⁶ -3.6×10⁶ -3.4×10⁶ -3.2×10⁶ -3.0×10⁶ -2.8×10⁶ -2.6×10⁶ -2.4×10⁶ -2.2×10⁶ -2.0×10⁶ -1.8×10⁶ -1.6×10⁶ -1.4×10⁶ -1.2×10⁶ -1.0×10⁶ -8.0×10⁵ -6.0×10⁵ -4.0×10⁵ -2.0×10⁵ 0 2.0×10⁵ 4.0×10⁵ 6.0×10⁵ 8.0×10⁵ 1.0×10⁶ 1.2×10⁶ 1.4×10⁶ 1.6×10⁶ 1.8×10⁶ 2.0×10⁶ 2.2×10⁶ 2.4×10⁶ 2.6×10⁶ 2.8×10⁶ 3.0×10⁶ 3.2×10⁶ 3.4×10⁶ 3.6×10⁶ 3.8×10⁶ 4.0×10⁶ 4.2×10⁶ 4.4×10⁶ 4.6×10⁶ 4.8×10⁶ 5.0×10⁶ 5.2×10⁶ 5.4×10⁶ 5.6×10⁶ 5.8×10⁶ 6.0×10⁶ -6×10⁶ -3×10⁶ 0 3×10⁶ 6×10⁶ -6.0×10⁶ -5.5×10⁶ -5.0×10⁶ -4.5×10⁶ -4.0×10⁶ -3.5×10⁶ -3.0×10⁶ -2.5×10⁶ -2.0×10⁶ -1.5×10⁶ -1.0×10⁶ -5.0×10⁵ 0 5.0×10⁵ 1.0×10⁶ 1.5×10⁶ 2.0×10⁶ 2.5×10⁶ 3.0×10⁶ 3.5×10⁶ 4.0×10⁶ 4.5×10⁶ 5.0×10⁶ 5.5×10⁶ 6.0×10⁶ y

In [20]:
include("../src/lib/graphing-rcall.jl")


INFO: Recompiling stale cache file /Users/jrising/.julia/lib/v0.4/RCall.ji for module RCall.
R installation found at "/Library/Frameworks/R.framework/Resources"
WARNING: using RCall.isna in module Main conflicts with an existing identifier.
Out[20]:
usmap (generic function with 2 methods)

In [21]:
usmap(counties)


WARNING: RCall.jl: Warning: package ‘ggplot2’ was built under R version 3.2.3
WARNING: RCall.jl: 
-----------------------------------------------------------
PBS Mapping 2.69.76 -- Copyright (C) 2003-2016 Fisheries and Oceans Canada

PBS Mapping comes with ABSOLUTELY NO WARRANTY;
for details see the file COPYING.
This is free software, and you are welcome to redistribute
it under certain conditions, as outlined in the above file.

A complete user guide 'PBSmapping-UG.pdf' is located at 
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/PBSmapping/doc/PBSmapping-UG.pdf

Packaged on 2015-04-23
Pacific Biological Station, Nanaimo

All available PBS packages can be found at
http://code.google.com/p/pbs-software/

To see demos, type '.PBSfigs()'.
-----------------------------------------------------------


WARNING: RCall.jl: Loading required package: maptools
Loading required package: sp
Warning: package ‘sp’ was built under R version 3.2.5
Checking rgeos availability: TRUE
Loading required package: foreign
Out[21]:
RCall.RObject{RCall.VecSxp}