Top Qs
Timeline
Chat
Perspective
Ggplot2
Data visualization package for R From Wikipedia, the free encyclopedia
Remove ads
ggplot2 is an open-source data visualization package for the statistical programming language R. Created by Hadley Wickham in 2005, ggplot2 is an implementation of Leland Wilkinson's Grammar of Graphics—a general scheme for data visualization which breaks up graphs into semantic components such as scales and layers. ggplot2 can serve as a replacement for the base graphics in R and contains a number of defaults for web and print display of common scales. Since 2005, ggplot2 has grown in use to become one of the most popular R packages.[2][3][4]
Remove ads
Updates
On 2 March 2012, ggplot2 version 0.9.0 was released with numerous changes to internal organization, scale construction and layers.[5]
On 25 February 2014, Hadley Wickham formally announced that "ggplot2 is shifting to maintenance mode. This means that we are no longer adding new features, but we will continue to fix major bugs, and consider new features submitted as pull requests. In recognition [of] this significant milestone, the next version of ggplot2 will be 1.0.0".[6]
On 21 December 2015, ggplot 2.0.0 was released. In the announcement, it was stated that "ggplot2 now has an official extension mechanism. This means that others can now easily create their [own] stats, geoms and positions, and provide them in other packages."[7]
Remove ads
Comparison with base graphics and other packages
Summarize
Perspective
In contrast to base R graphics, ggplot2 allows the user to add, remove or alter components in a plot at a high level of abstraction.[8] This abstraction comes at a cost, with ggplot2 being slower than lattice graphics.[9]
Creating separate plots for various subsets of data in base R requires loops and manual management, whereas ggplot2 simplifies that process with a collection of "facet" functions to choose from.[10]
One potential limitation of base R graphics is the "pen-and-paper model" utilized to populate the plotting device.[11] Graphical output from the interpreter is added directly to the plotting device or window, rather than separately for each distinct element of a plot.[12] In this respect it is similar to the lattice package, though Wickham argues ggplot2 inherits a more formal model of graphics from Wilkinson.[13] As such, it allows for a high degree of modularity; the same underlying data can be transformed by many different scales or layers.[14][15]
Plots may be created via the convenience function qplot()
where arguments and defaults are meant to be similar to base R's plot()
function.[16][17] More complex plotting capacity is available via ggplot()
which exposes the user to more explicit elements of the grammar.[18]
Remove ads
Impact
After ten years of being developed, ggplot2 has continued to make an impact on the data visualization community: with over 10 million downloads, 400,000 downloads in a given month, and data scientists from the US government to journalists at the New York Times use ggplot2 to analyze and present data.[19] Wickham posits the success of ggplot2 comes from the increased popularity of the R language and the relative ease of making aesthetically appealing graphics. Along with more serious uses of ggplot2, Wickham also supports the more unusual use cases, like exploring factors for winning in the reality TV show RuPaul's Drag Race.
Related projects
- ggpy, ggplot for Python,[20] but has not been updated since 20 November 2016
- plotnine[21] started as an effort to improve the scalability of ggplot for Python and is largely compatible with ggplot2 syntax.
- Plotly - Interactive, online ggplot2 graphs[22]
- gramm, a plotting class for MATLAB inspired by ggplot2[23]
- gadfly, a system for plotting and visualization written in Julia, based largely on ggplot2[24]
- Chart::GGPlot - ggplot2 port in Perl[25]
- The Lets-Plot for Python library includes a native backend and a Python API, which was mostly based on the ggplot2 package well-known to data scientists who use R.[26]
- Lets-Plot Kotlin API is an open-source plotting library for statistical data implemented using the Kotlin programming language, and is built on the principles of layered graphics first described in the Leland Wilkinson's work The Grammar of Graphics.[27]
- ggplotnim, plotting library using the Nim programming language inspired by ggplot2.[28]
- Vega and Vega-Lite are plotting libraries that use JSON to specify plots.
Remove ads
References
Further reading
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads