Quiver Plots for 'ggplot2'

An extension of 'ggplot2' to provide quiver plots to visualise vector fields. This functionality is implemented using a geom to produce a new graphical layer, which allows aesthetic options. This layer can be overlaid on a map to improve visualisation of mapped data.

Travis-CI BuildStatus CRAN_Status_Badge Downloads

Quiver plots for ggplot2.


The stable version can be installed from CRAN:


The development version can be installed from GitHub using:



ggquiver introduces a new geom geom_quiver(), which produces a quiver plot in ggplot2.

Quiver plots for functions can easily be produced using ggplot aeshetics. When a grid is detected, the size of the vectors are automatically adjusted to fit within the grid.

expand.grid(x=seq(0,pi,pi/12), y=seq(0,pi,pi/12)) %>%
  ggplot(aes(x=x,y=y,u=cos(x),v=sin(y))) +

The ggplot2 example for seal movements is easily reproduced, with appropriately scaled arrowhead sizes. Here, the vecsize is set to zero to not resize the vectors.

ggplot(seals, aes(x=long, y=lat, u=delta_long, v=delta_lat)) + 
  geom_quiver(vecsize=0) + 

Quiver plot arrows can be centered about x and y coordinates, which is useful when working with maps and scaled vectors.

wind_data <- wind %>% filter(between(lon, -96, -93) & between(lat, 28.7, 30))
qmplot(lon, lat, data=wind_data, extent="panel", geom = "blank", zoom=8, maptype = "toner-lite") + 
  geom_quiver(aes(u=delta_lon, v=delta_lat, colour = spd), center=TRUE)


Version 0.2.0 (5 February 2019)

  • Changed ggplot2 to import
  • Updated README to reflect ggmap changes

Version 0.1.0 (9 August 2017)

  • Added automatic grid detection
  • Added a NEWS.md.
  • Added geom_quiver() and stat_quiver()
  • Added unit tests

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.3.1 by Mitchell O'Hara-Wild, 4 days ago

https://github.com/mitchelloharawild/ggquiver, https://pkg.mitchelloharawild.com/ggquiver/

Report a bug at https://github.com/mitchelloharawild/ggquiver/issues

Browse source code at https://github.com/cran/ggquiver

Authors: Mitchell O'Hara-Wild [aut, cre]

Documentation:   PDF Manual  

GPL-3 license

Imports ggplot2

Suggests dplyr, ggmap, maps, pkgdown, testthat

Imported by CoSMoS.

See at CRAN