[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572742-105":53,"doc-detail-572742-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","data-visualization-with-ggplot2-cheatsheet-geoms-and-aesthetics","Data visualization with ggplot2 - CHEATSHEET - Geoms and Aesthetics","","A concise cheat sheet for data visualization in ggplot2, focused on mapping data variables to geom aesthetics and constructing plots using ggplot’s grammar of graphics. Covers common aesthetic parameters (color, fill, linetype, size, shape, alpha), coordinate system usage, and major geom families for points, paths, areas, lines, error bars, and polygons. Includes guidance on one- and two-variable plots, discrete vs continuous distributions, quantile styling, function-like layers, and basic geospatial mapping with geom_sf.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/data-visualization-with-ggplot2-cheatsheet-geoms-and-aesthetics/572742/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/data-visualization-with-ggplot2-cheatsheet-geoms-and-aesthetics/572742.png","ImageObject",442,249,{"name":88,"@type":89},"Putri","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How does ggplot2 map variables to show information in a plot?","Question",{"text":108,"@type":109},"Data variables are mapped to geom aesthetic properties using aes(), such as x/y locations, size, color, alpha, and shape. This determines how values are visually encoded.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"Which ggplot2 geoms are used for continuous versus discrete data?",{"text":113,"@type":109},"For continuous distributions, use geoms like geom_area, geom_density, geom_histogram, geom_line, and geom_smooth. For discrete data, use geoms like geom_bar, geom_col, and geom_boxplot depending on the summary style desired.",{"name":115,"@type":106,"acceptedAnswer":116},"How can you visualize error ranges in ggplot2?",{"text":117,"@type":109},"Use geoms designed for uncertainty, such as geom_errorbar and geom_linerange for interval marks, or geom_pointrange for point plus range. These layers map ymin/ymax (or equivalent) to show variability.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},572742,1792360139,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":9},962085571259,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","Data visualization with ggplot2 : : CHEATSHEET   \nGeoms UseEachafguenocmtiofunnrcettonrntso reprea layersent data points, use the geom’s aesthetic properties to represent variables.  \n+ =  \nTo display values, map variables in the data to visual properties of the geom (aesthetics) like size, color, and x and y locations.  \n+ =  \ncoordinate  \nsystem  \nAes Common aesthetic values.  \ncolor and fill-string (\"red\", \"\\#RRGGBB\")  \nlinetype-integer or string (0 = \"blank\", 1 = \"solid\",  \n2 = \"dashed\", 3 = \"dotted\", 4 = \"dotdash\", 5 = \"longdash\", 6 = \"twodash\")  \nsize-integer (in mm for size of points and text) linewidth-integer (in mm for widths of lines)  \nshape-integer/shape name ora single character (\"a\")  \nGRAPHICAL PRIMITIVES  \na \u003C-ggplot(economics, aes(date, unemploy)) b \u003C-ggplot(seals, aes(x = long, y = lat))  \na + geom_blank() and a + expand_limits() Ensure limits include values across all plots. b + geom_curve(aes(yend = lat + 1,  \nxend = long + 1), curvature = 1) -x, xend, y, yend,  \nalpha, angle, color, curvature, linetype, size a + geom_path(lineend = \"butt\", linejoin = \"round\", linemitre = 1)  \nx, y, alpha, color, group, linetype, size  \na + geom_polygon(aes(alpha = 50)) -x, y, alpha, color, fill, group, subgroup, linetype, size  \nb + geom_rect(aes(xmin = long, ymin = lat, xmax = long + 1, ymax = lat + 1)) -xmax, xmin, ymax, ymin, alpha, color, fill, linetype, size a + geom_ribbon(aes(ymin = unemploy-900, ymax = unemploy + 900)) -x, ymax, ymin, alpha, color, fill, group, linetype, size  \nLINE SEGMENTS  \ncommon aesthetics: x, y, alpha, color, linetype, size b + geom_abline(aes(intercept = 0, slope = 1))  \nb + geom_hline(aes(yintercept = lat))  \nb + geom_vline(aes(xintercept = long))  \nb + geom_segment(aes(yend = lat + 1, xend = long + 1)) b + geom_spoke(aes(angle = 1:1155, radius = 1))  \nONE VARIABLE continuous  \nc \u003C-ggplot(mpg, aes(hwy)); c2 \u003C-ggplot(mpg)  \nc + geom_area(stat = \"bin\")  \nx, y, alpha, color, fill, linetype, size  \nc + geom_density(kernel = \"gaussian\")  \nx, y, alpha, color, fill, group, linetype, size, weight c + geom_dotplot()  \nx, y, alpha, color, fill  \nc + geom_freqpoly()  \nx, y, alpha, color, group, linetype, size  \nc + geom_histogram(binwidth = 5)  \nx, y, alpha, color, fill, linetype, size, weight  \nc2 + geom_qq(aes(sample = hwy))  \nx, y, alpha, color, fill, linetype, size, weight  \ndiscrete  \nd \u003C-ggplot(mpg, aes(fl))  \nd + geom_bar()  \nx, alpha, color, fill, linetype, size, weight  \nTWO VARIABLES both continuous  \ne \u003C-ggplot(mpg, aes(cty, hwy))  \ncontinuous bivariate distribution  \nh \u003C-ggplot(diamonds, aes(carat, price))  \ne + geom_label(aes(label = cty)) -x, y, label, alpha, angle, color, family, fontface, hjust, lineheight, size, vjust  \ne + geom_point()  \nx, y, alpha, color, fill, shape, size, stroke  \ne + geom_quantile()  \nx, y, alpha, color, group, linetype, size, weight  \ne + geom_rug(sides = “bl\") x, y, alpha, color, linetype, size  \ne + geom_smooth(method = lm)  \nx, y, alpha, color, fill, group, linetype, size, weight e + geom_text(aes(label = cty)) -x, y, label, alpha, angle, color, family, fontface, hjust,  \nlineheight, size, vjust  \none discrete, one continuous  \nf \u003C-ggplot(mpg, aes(class, hwy))  \nf + geom_col()  \nx, y, alpha, color, fill, group, linetype, size  \nf + geom_boxplot()  \nx, y, lower, middle, upper, ymax, ymin, alpha, color, fill, group, linetype, shape, size, weight. Style individual parts with median.*, box.*, whisker.*, staple.* .  \nf + geom_dotplot(binaxis = \"y\", stackdir = “center\") x, y, alpha, color, fill, group  \nf + geom_violin(scale = “area\")  \nx, y, alpha, color, fill, group, linetype, size, weight Use quantiles to compute quantile lines and quantile.color, quantile.linetype, quantile.linewidth to style.  \nboth discrete  \ng \u003C-ggplot(diamonds, aes(cut, color))  \ng + geom_count()  \nx, y, alpha, color, fill, shape, size, stroke e + geom_jitter(height = 2, width = 2) x, y, alpha, color, fill, shape, size  \nh + geom_bin2d(binwidth = c(0.25, 500)) x, y, alpha, color, fill, li","cbCaijN9BtF2dtnc","https://ap.wps.com/l/cbCaijN9BtF2dtnc","pdf",1109698,"English","# Geoms and Aesthetics\n## Common Aesthetics\n# Building Plot Layers (Grammar of Graphics)\n## Geometric Primitives\n# Lines and Segments\n## Line Segments and Line Types\n# One and Two Variable Visualizations\n## One Variable (Continuous)\n## One Variable (Discrete)\n## Two Variables (Bivariate)\n# Error Visualization\n## Visualizing Error\n# Maps\n## geom_sf and Simple Features\n# Three-Dimensional Variables and Surfaces\n## THREE and z-Based Geoms","[{\"question\":\"How does ggplot2 map variables to show information in a plot?\",\"answer\":\"Data variables are mapped to geom aesthetic properties using aes(), such as x/y locations, size, color, alpha, and shape. This determines how values are visually encoded.\"},{\"question\":\"Which ggplot2 geoms are used for continuous versus discrete data?\",\"answer\":\"For continuous distributions, use geoms like geom_area, geom_density, geom_histogram, geom_line, and geom_smooth. For discrete data, use geoms like geom_bar, geom_col, and geom_boxplot depending on the summary style desired.\"},{\"question\":\"How can you visualize error ranges in ggplot2?\",\"answer\":\"Use geoms designed for uncertainty, such as geom_errorbar and geom_linerange for interval marks, or geom_pointrange for point plus range. These layers map ymin/ymax (or equivalent) to show variability.\"}]","Data visualization with ggplot2 - CHEATSHEET - Geoms and Aesthetics | PDF",1791929097]