Package: ggplot2 3.5.1.9000
ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics
A system for 'declaratively' creating graphics, based on "The Grammar of Graphics". You provide the data, tell 'ggplot2' how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.
Authors:
ggplot2_3.5.1.9000.tar.gz
ggplot2_3.5.1.9000.zip(r-4.5)ggplot2_3.5.1.9000.zip(r-4.4)ggplot2_3.5.1.9000.zip(r-4.3)
ggplot2_3.5.1.9000.tgz(r-4.4-any)ggplot2_3.5.1.9000.tgz(r-4.3-any)
ggplot2_3.5.1.9000.tar.gz(r-4.5-noble)ggplot2_3.5.1.9000.tar.gz(r-4.4-noble)
ggplot2_3.5.1.9000.tgz(r-4.4-emscripten)ggplot2_3.5.1.9000.tgz(r-4.3-emscripten)
ggplot2.pdf |ggplot2.html✨
ggplot2/json (API)
NEWS
# Install 'ggplot2' in R: |
install.packages('ggplot2', repos = c('https://tidyverse.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/tidyverse/ggplot2/issues
Pkgdown:https://ggplot2.tidyverse.org
- diamonds - Prices of over 50,000 round cut diamonds
- economics - US economic time series
- economics_long - US economic time series
- faithfuld - 2d density estimate of Old Faithful data
- luv_colours - 'colors()' in Luv space
- midwest - Midwest demographics
- mpg - Fuel economy data from 1999 to 2008 for 38 popular models of cars
- msleep - An updated and expanded version of the mammals sleep dataset
- presidential - Terms of 12 presidents from Eisenhower to Trump
- seals - Vector field of seal movements
- txhousing - Housing sales in TX
data-visualisationvisualisation
Last updated 1 hours agofrom:efc53cc000. Checks:OK: 1 NOTE: 6. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Dec 17 2024 |
R-4.5-win | NOTE | Dec 17 2024 |
R-4.5-linux | NOTE | Dec 17 2024 |
R-4.4-win | NOTE | Dec 17 2024 |
R-4.4-mac | NOTE | Dec 17 2024 |
R-4.3-win | NOTE | Dec 17 2024 |
R-4.3-mac | NOTE | Dec 17 2024 |
Exports:.data.expose_data.ignore_data.pt.stroke%+%%+replace%aesaes_aes_allaes_autoaes_qaes_stringafter_scaleafter_statalphaannotateannotation_customannotation_logticksannotation_mapannotation_rasterarrowas_labelas_labellerautolayerautoplotAxisSecondarybenchplotbinned_scaleborderscalc_elementcheck_devicecombine_varscomplete_themecontinuous_scaleCoordcoord_cartesiancoord_equalcoord_fixedcoord_flipcoord_mapcoord_munchcoord_polarcoord_quickmapcoord_radialcoord_sfcoord_transCoordCartesianCoordFixedCoordFlipCoordMapCoordPolarCoordQuickmapCoordRadialCoordSfCoordTranscut_intervalcut_numbercut_widthdatetime_scalederivediscrete_scaledraw_key_ablinedraw_key_blankdraw_key_boxplotdraw_key_crossbardraw_key_dotplotdraw_key_labeldraw_key_linerangedraw_key_pathdraw_key_pointdraw_key_pointrangedraw_key_polygondraw_key_rectdraw_key_smoothdraw_key_textdraw_key_timeseriesdraw_key_vlinedraw_key_vpathdup_axisel_defelement_blankelement_geomelement_grobelement_lineelement_rectelement_renderelement_textenexprenexprsenquoenquosensymensymsexpand_limitsexpand_scaleexpansionexprFacetfacet_gridfacet_nullfacet_wrapFacetGridFacetNullFacetWrapfill_alphafind_panelflip_dataflipped_namesfortifyfrom_themeGeomgeom_ablinegeom_areageom_bargeom_bin_2dgeom_bin2dgeom_blankgeom_boxplotgeom_colgeom_contourgeom_contour_filledgeom_countgeom_crossbargeom_curvegeom_densitygeom_density_2dgeom_density_2d_filledgeom_density2dgeom_density2d_filledgeom_dotplotgeom_errorbargeom_errorbarhgeom_freqpolygeom_functiongeom_hexgeom_histogramgeom_hlinegeom_jittergeom_labelgeom_linegeom_linerangegeom_mapgeom_pathgeom_pointgeom_pointrangegeom_polygongeom_qqgeom_qq_linegeom_quantilegeom_rastergeom_rectgeom_ribbongeom_ruggeom_segmentgeom_sfgeom_sf_labelgeom_sf_textgeom_smoothgeom_spokegeom_stepgeom_textgeom_tilegeom_violingeom_vlineGeomAblineGeomAnnotationMapGeomAreaGeomBarGeomBin2dGeomBlankGeomBoxplotGeomColGeomContourGeomContourFilledGeomCrossbarGeomCurveGeomCustomAnnGeomDensityGeomDensity2dGeomDensity2dFilledGeomDotplotGeomErrorbarGeomErrorbarhGeomFunctionGeomHexGeomHlineGeomLabelGeomLineGeomLinerangeGeomLogticksGeomMapGeomPathGeomPointGeomPointrangeGeomPolygonGeomQuantileGeomRasterGeomRasterAnnGeomRectGeomRibbonGeomRugGeomSegmentGeomSfGeomSmoothGeomSpokeGeomStepGeomTextGeomTileGeomViolinGeomVlineget_alt_textget_element_treeget_geom_defaultsget_guide_dataget_labsget_last_plotget_layer_dataget_layer_grobget_panel_scalesget_strip_labelsget_themegg_depgg_parggplotggplot_addggplot_buildggplot_gtableggplotGrobggprotoggproto_parentggsaveggtitleGuideguide_axisguide_axis_logticksguide_axis_stackguide_axis_thetaguide_binsguide_colorbarguide_colorstepsguide_colourbarguide_colourstepsguide_customguide_gengrobguide_geomguide_legendguide_mergeguide_noneguide_trainguide_transformGuideAxisGuideAxisLogticksGuideAxisStackGuideAxisThetaGuideBinsGuideColourbarGuideColourstepsGuideCustomGuideLegendGuideNoneGuideOldguideshas_flipped_aesis.coordis.Coordis.facetis.geomis.ggplotis.ggprotois.guideis.guidesis.layeris.mappingis.marginis.positionis.scaleis.statis.themeis.theme_elementis.waiverlabel_bothlabel_bquotelabel_contextlabel_parsedlabel_valuelabel_wrap_genlabellerlabslast_plotlayerlayer_datalayer_groblayer_scaleslayer_sfLayoutlimsmap_datamarginmargin_automargin_partmax_heightmax_widthmean_cl_bootmean_cl_normalmean_sdlmean_semedian_hilowmerge_elementnew_guideold_guidepanel_colspanel_rowspattern_alphaPositionposition_dodgeposition_dodge2position_fillposition_identityposition_jitterposition_jitterdodgeposition_nudgeposition_stackPositionDodgePositionDodge2PositionFillPositionIdentityPositionJitterPositionJitterdodgePositionNudgePositionStackqplotquickplotquoquo_namequosregister_theme_elementsrelremove_missingrender_axesrender_stripsreplace_themereset_geom_defaultsreset_stat_defaultsreset_theme_settingsresolutionScalescale_alphascale_alpha_binnedscale_alpha_continuousscale_alpha_datescale_alpha_datetimescale_alpha_discretescale_alpha_identityscale_alpha_manualscale_alpha_ordinalscale_color_binnedscale_color_brewerscale_color_continuousscale_color_datescale_color_datetimescale_color_discretescale_color_distillerscale_color_fermenterscale_color_gradientscale_color_gradient2scale_color_gradientnscale_color_greyscale_color_huescale_color_identityscale_color_manualscale_color_ordinalscale_color_stepsscale_color_steps2scale_color_stepsnscale_color_viridis_bscale_color_viridis_cscale_color_viridis_dscale_colour_binnedscale_colour_brewerscale_colour_continuousscale_colour_datescale_colour_datetimescale_colour_discretescale_colour_distillerscale_colour_fermenterscale_colour_gradientscale_colour_gradient2scale_colour_gradientnscale_colour_greyscale_colour_huescale_colour_identityscale_colour_manualscale_colour_ordinalscale_colour_stepsscale_colour_steps2scale_colour_stepsnscale_colour_viridis_bscale_colour_viridis_cscale_colour_viridis_dscale_continuous_identityscale_discrete_identityscale_discrete_manualscale_fill_binnedscale_fill_brewerscale_fill_continuousscale_fill_datescale_fill_datetimescale_fill_discretescale_fill_distillerscale_fill_fermenterscale_fill_gradientscale_fill_gradient2scale_fill_gradientnscale_fill_greyscale_fill_huescale_fill_identityscale_fill_manualscale_fill_ordinalscale_fill_stepsscale_fill_steps2scale_fill_stepsnscale_fill_viridis_bscale_fill_viridis_cscale_fill_viridis_dscale_linetypescale_linetype_binnedscale_linetype_continuousscale_linetype_discretescale_linetype_identityscale_linetype_manualscale_linewidthscale_linewidth_binnedscale_linewidth_continuousscale_linewidth_datescale_linewidth_datetimescale_linewidth_discretescale_linewidth_identityscale_linewidth_manualscale_linewidth_ordinalscale_radiusscale_shapescale_shape_binnedscale_shape_continuousscale_shape_discretescale_shape_identityscale_shape_manualscale_shape_ordinalscale_sizescale_size_areascale_size_binnedscale_size_binned_areascale_size_continuousscale_size_datescale_size_datetimescale_size_discretescale_size_identityscale_size_manualscale_size_ordinalscale_typescale_x_binnedscale_x_continuousscale_x_datescale_x_datetimescale_x_discretescale_x_log10scale_x_reversescale_x_sqrtscale_x_timescale_y_binnedscale_y_continuousscale_y_datescale_y_datetimescale_y_discretescale_y_log10scale_y_reversescale_y_sqrtscale_y_timeScaleBinnedScaleBinnedPositionScaleContinuousScaleContinuousDateScaleContinuousDatetimeScaleContinuousIdentityScaleContinuousPositionScaleDiscreteScaleDiscreteIdentityScaleDiscretePositionsec_axisset_last_plotset_themesf_transform_xyshould_stopstagestandardise_aes_namesstatStatstat_alignstat_binstat_bin_2dstat_bin_hexstat_bin2dstat_binhexstat_boxplotstat_contourstat_contour_filledstat_countstat_densitystat_density_2dstat_density_2d_filledstat_density2dstat_density2d_filledstat_ecdfstat_ellipsestat_functionstat_identitystat_manualstat_qqstat_qq_linestat_quantilestat_sfstat_sf_coordinatesstat_smoothstat_spokestat_sumstat_summarystat_summary_2dstat_summary_binstat_summary_hexstat_summary2dstat_uniquestat_ydensityStatAlignStatBinStatBin2dStatBindotStatBinhexStatBoxplotStatContourStatContourFilledStatCountStatDensityStatDensity2dStatDensity2dFilledStatEcdfStatEllipseStatFunctionStatIdentityStatManualStatQqStatQqLineStatQuantileStatSfStatSfCoordinatesStatSmoothStatSumStatSummaryStatSummary2dStatSummaryBinStatSummaryHexStatUniqueStatYdensitysummarise_coordsummarise_layerssummarise_layoutsymsymsthemetheme_bwtheme_classictheme_darktheme_gettheme_graytheme_greytheme_lighttheme_linedrawtheme_minimaltheme_replacetheme_settheme_testtheme_transparenttheme_updatetheme_voidtransform_positiontranslate_shape_stringunitupdate_geom_defaultsupdate_labelsupdate_stat_defaultsupdate_themevarswaiverwrap_dimsxlabxlimylabylimzeroGrob
Dependencies:clicolorspacefarvergluegtableisobandlabelinglifecyclemunsellR6RColorBrewerrlangscalesvctrsviridisLitewithr
Aesthetic specifications
Rendered fromggplot2-specs.Rmd
usingknitr::rmarkdown
on Dec 17 2024.Last update: 2024-12-13
Started: 2015-08-14
Extending ggplot2
Rendered fromextending-ggplot2.Rmd
usingknitr::rmarkdown
on Dec 17 2024.Last update: 2024-10-30
Started: 2015-08-05
Introduction to ggplot2
Rendered fromggplot2.Rmd
usingknitr::rmarkdown
on Dec 17 2024.Last update: 2024-10-30
Started: 2023-09-11
Using ggplot2 in packages
Rendered fromggplot2-in-packages.Rmd
usingknitr::rmarkdown
on Dec 17 2024.Last update: 2024-12-02
Started: 2019-06-04
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Add components to a plot | %+% +.gg |
Construct aesthetic mappings | aes |
Colour related aesthetics: colour, fill, and alpha | aes_colour_fill_alpha color colour fill |
Control aesthetic evaluation | aes_eval after_scale after_stat from_theme stage stat |
Aesthetics: grouping | aes_group_order group |
Differentiation related aesthetics: linetype, size, shape | aes_linetype_size_shape linetype shape size |
Position related aesthetics: x, y, xmin, xmax, ymin, ymax, xend, yend | aes_position x xend xmax xmin y yend ymax ymin |
Create an annotation layer | annotate |
Annotation: Custom grob | annotation_custom |
Annotation: log tick marks | annotation_logticks |
Annotation: a map | annotation_map |
Annotation: high-performance rectangular tiling | annotation_raster |
Create a ggplot layer appropriate to a particular data type | autolayer |
Tailoring plots to particular data types | automatic_plotting |
Create a complete ggplot appropriate to a particular data type | autoplot |
Create a layer of map borders | borders |
Cartesian coordinates | coord_cartesian |
Cartesian coordinates with fixed "aspect ratio" | coord_equal coord_fixed |
Cartesian coordinates with x and y flipped | coord_flip |
Map projections | coord_map coord_quickmap |
Polar coordinates | coord_polar coord_radial |
Transformed Cartesian coordinate system | coord_trans |
Visualise sf objects | CoordSf coord_sf GeomSf geom_sf geom_sf_label geom_sf_text ggsf StatSf stat_sf |
Discretise numeric data into categorical | cut_interval cut_number cut_width |
Prices of over 50,000 round cut diamonds | diamonds |
Key glyphs for legends | draw_key draw_key_abline draw_key_blank draw_key_boxplot draw_key_crossbar draw_key_dotplot draw_key_label draw_key_linerange draw_key_path draw_key_point draw_key_pointrange draw_key_polygon draw_key_rect draw_key_smooth draw_key_text draw_key_timeseries draw_key_vline draw_key_vpath |
US economic time series | economics economics_long |
Theme elements | element_blank element_geom element_line element_rect element_text margin margin_auto margin_part rel |
Expand the plot limits, using data | expand_limits |
Generate expansion vector for scales | expand_scale expansion |
Lay out panels in a grid | facet_grid |
Wrap a 1d ribbon of panels into 2d | facet_wrap |
2d density estimate of Old Faithful data | faithfuld |
Fortify a model with data. | fortify |
Reference lines: horizontal, vertical, and diagonal | geom_abline geom_hline geom_vline |
Bar charts | geom_bar geom_col stat_count |
Heatmap of 2d bin counts | geom_bin2d geom_bin_2d stat_bin2d stat_bin_2d |
Draw nothing | geom_blank |
A box and whiskers plot (in the style of Tukey) | geom_boxplot stat_boxplot |
2D contours of a 3D surface | geom_contour geom_contour_filled stat_contour stat_contour_filled |
Count overlapping points | geom_count stat_sum |
Vertical intervals: lines, crossbars & errorbars | geom_crossbar geom_errorbar geom_errorbarh geom_linerange geom_pointrange |
Smoothed density estimates | geom_density stat_density |
Contours of a 2D density estimate | geom_density2d geom_density2d_filled geom_density_2d geom_density_2d_filled stat_density2d stat_density2d_filled stat_density_2d stat_density_2d_filled |
Dot plot | geom_dotplot |
Histograms and frequency polygons | geom_freqpoly geom_histogram stat_bin |
Draw a function as a continuous curve | geom_function stat_function |
Hexagonal heatmap of 2d bin counts | geom_hex stat_binhex stat_bin_hex |
Jittered points | geom_jitter |
Text | geom_label geom_text |
Polygons from a reference map | geom_map |
Connect observations | geom_line geom_path geom_step |
Points | geom_point |
Polygons | geom_polygon |
A quantile-quantile plot | geom_qq geom_qq_line stat_qq stat_qq_line |
Quantile regression | geom_quantile stat_quantile |
Rectangles | geom_raster geom_rect geom_tile |
Ribbons and area plots | geom_area geom_ribbon stat_align |
Rug plots in the margins | geom_rug |
Line segments and curves | geom_curve geom_segment |
Smoothed conditional means | geom_smooth stat_smooth |
Line segments parameterised by location, direction and distance | geom_spoke stat_spoke |
Violin plot | geom_violin stat_ydensity |
Extract alt text from a plot | alt_text get_alt_text |
Get, set, and modify the active theme | %+replace% get_theme replace_theme set_theme theme_get theme_replace theme_set theme_update update_theme |
Create a new ggplot | ggplot |
Create a new ggproto object | ggproto ggproto_parent |
Save a ggplot (or other grid object) with sensible defaults | ggsave |
Complete themes | theme_bw theme_classic theme_dark theme_gray theme_grey theme_light theme_linedraw theme_minimal theme_test theme_transparent theme_void |
Axis guide | guide_axis |
Axis with logarithmic tick marks | guide_axis_logticks |
Stacked axis guides | guide_axis_stack |
Angle axis guide | guide_axis_theta |
A binned version of guide_legend | guide_bins |
Continuous colour bar guide | guide_colorbar guide_colourbar |
Discretized colourbar guide | guide_colorsteps guide_coloursteps |
Custom guides | guide_custom |
Legend guide | guide_legend |
Empty guide | guide_none |
Set guides for each scale | guides |
A selection of summary functions from Hmisc | hmisc mean_cl_boot mean_cl_normal mean_sdl median_hilow |
Label with mathematical expressions | label_bquote |
Construct labelling specification | labeller |
Useful labeller functions | labellers label_both label_context label_parsed label_value label_wrap_gen |
Modify axis, legend, and plot labels | get_labs ggtitle labs xlab ylab |
Layer geometry display | layer_geoms |
Layer position adjustments | layer_positions |
Layer statistical transformations | layer_stats |
Set scale limits | lims xlim ylim |
'colors()' in Luv space | luv_colours |
Calculate mean and standard error of the mean | mean_se |
Midwest demographics | midwest |
Fuel economy data from 1999 to 2008 for 38 popular models of cars | mpg |
An updated and expanded version of the mammals sleep dataset | msleep |
Dodge overlapping objects side-to-side | position_dodge position_dodge2 |
Don't adjust position | position_identity |
Jitter points to avoid overplotting | position_jitter |
Simultaneously dodge and jitter | position_jitterdodge |
Nudge points a fixed distance | position_nudge |
Stack overlapping objects on top of each another | position_fill position_stack |
Terms of 12 presidents from Eisenhower to Trump | presidential |
Explicitly draw plot | plot.ggplot print.ggplot |
Format or print a ggproto object | format.ggproto print.ggproto |
Quick plot | qplot quickplot |
Compute the "resolution" of a numeric vector | resolution |
Alpha transparency scales | scale_alpha scale_alpha_binned scale_alpha_continuous scale_alpha_date scale_alpha_datetime scale_alpha_discrete scale_alpha_ordinal |
Positional scales for binning continuous data (x & y) | scale_x_binned scale_y_binned |
Sequential, diverging and qualitative colour scales from ColorBrewer | scale_color_brewer scale_color_distiller scale_color_fermenter scale_colour_brewer scale_colour_distiller scale_colour_fermenter scale_fill_brewer scale_fill_distiller scale_fill_fermenter |
Continuous and binned colour scales | scale_color_binned scale_color_continuous scale_colour_binned scale_colour_continuous scale_fill_binned scale_fill_continuous |
Discrete colour scales | scale_color_discrete scale_colour_discrete scale_fill_discrete |
Gradient colour scales | scale_color_date scale_color_datetime scale_color_gradient scale_color_gradient2 scale_color_gradientn scale_colour_date scale_colour_datetime scale_colour_gradient scale_colour_gradient2 scale_colour_gradientn scale_fill_date scale_fill_datetime scale_fill_gradient scale_fill_gradient2 scale_fill_gradientn |
Sequential grey colour scales | scale_color_grey scale_colour_grey scale_fill_grey |
Evenly spaced colours for discrete data | scale_color_hue scale_colour_hue scale_fill_hue |
Binned gradient colour scales | scale_color_steps scale_color_steps2 scale_color_stepsn scale_colour_steps scale_colour_steps2 scale_colour_stepsn scale_fill_steps scale_fill_steps2 scale_fill_stepsn |
Viridis colour scales from viridisLite | scale_color_ordinal scale_color_viridis_b scale_color_viridis_c scale_color_viridis_d scale_colour_ordinal scale_colour_viridis_b scale_colour_viridis_c scale_colour_viridis_d scale_fill_ordinal scale_fill_viridis_b scale_fill_viridis_c scale_fill_viridis_d |
Position scales for continuous data (x & y) | scale_x_continuous scale_x_log10 scale_x_reverse scale_x_sqrt scale_y_continuous scale_y_log10 scale_y_reverse scale_y_sqrt |
Position scales for date/time data | scale_x_date scale_x_datetime scale_x_time scale_y_date scale_y_datetime scale_y_time |
Use values without scaling | scale_alpha_identity scale_color_identity scale_colour_identity scale_continuous_identity scale_discrete_identity scale_fill_identity scale_linetype_identity scale_linewidth_identity scale_shape_identity scale_size_identity |
Scale for line patterns | scale_linetype scale_linetype_binned scale_linetype_continuous scale_linetype_discrete |
Scales for line width | scale_linewidth scale_linewidth_binned scale_linewidth_continuous scale_linewidth_date scale_linewidth_datetime scale_linewidth_discrete scale_linewidth_ordinal |
Create your own discrete scale | scale_alpha_manual scale_color_manual scale_colour_manual scale_discrete_manual scale_fill_manual scale_linetype_manual scale_linewidth_manual scale_shape_manual scale_size_manual |
Scales for shapes, aka glyphs | scale_shape scale_shape_binned scale_shape_continuous scale_shape_discrete scale_shape_ordinal |
Scales for area or radius | scale_radius scale_size scale_size_area scale_size_binned scale_size_binned_area scale_size_continuous scale_size_date scale_size_datetime scale_size_discrete scale_size_ordinal |
Position scales for discrete data | scale_x_discrete scale_y_discrete |
Vector field of seal movements | seals |
Specify a secondary axis | derive dup_axis sec_axis |
Compute empirical cumulative distribution | stat_ecdf |
Compute normal data ellipses | stat_ellipse |
Leave data as is | stat_identity |
Manually compute transformations | stat_manual |
Extract coordinates from 'sf' objects | StatSfCoordinates stat_sf_coordinates |
Bin and summarise in 2d (rectangle & hexagons) | stat_summary2d stat_summary_2d stat_summary_hex |
Summarise y values at unique/binned x | stat_summary stat_summary_bin |
Remove duplicates | stat_unique |
Modify components of a theme | theme |
Housing sales in TX | txhousing |
Quote faceting variables | vars |