{"id":874,"date":"2022-10-18T07:48:22","date_gmt":"2022-10-18T05:48:22","guid":{"rendered":"urn:uuid:f70200c5-5ae1-437b-b949-18447bb68433"},"modified":"2025-04-02T12:44:46","modified_gmt":"2025-04-02T10:44:46","slug":"data-visualization","status":"publish","type":"post","link":"https:\/\/www.datahouse.ch\/en\/blog\/data-visualization\/","title":{"rendered":"Understanding data through visualizations"},"content":{"rendered":"\n<div class=\"wp-block-group is-style-without-space is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.7%\">\n<p>The human brain processes images and graphics 60,000 times faster than text. No wonder, <a href=\"https:\/\/www.t-sciences.com\/news\/humans-process-visual-data-better\" target=\"_blank\" rel=\"noreferrer noopener\">around 90 percent of all information transported to our brain is visual<\/a>. The following infographic shows the most frequent birth dates of people born in Switzerland since 1969. A table with births on 366 days a year is difficult to interpret. But the heatmap reveals interesting insights at first glance:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>February 29, which only exists in leap years, has (unsurprisingly) by far the fewest births<\/li>\n\n\n\n<li>Holidays such as January 1st, Christmas and the national holiday on August 1st are also rare. Probably due to scheduled C-sections, which hospitals prefer to schedule on workdays before or after holidays<\/li>\n\n\n\n<li>Most birthdays are celebrated in the second half of September (around nine months after the Christmas holidays and New Year&#8217;s Eve \ud83d\ude09)<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:88%\">\n<div class=\"image__wrapper alignfull withoutShadow\"><figure class=\"wp-block-image alignfull size-full size-large is-resized is-style-default withoutDescription withoutShadow\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Birthdays_Info_en.webp\" alt=\"\" class=\"wp-image-3875\" srcset=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Birthdays_Info_en.webp 1024w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Birthdays_Info_en-300x148.webp 300w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Birthdays_Info_en-768x379.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.7%\">\n<p>The same applies to the business environment: Only those who can visualize their data in a comprehensible way allow users to interpret it meaningfully and generate added value from the findings. These graphics are presented on interactive dashboards, created for example with the business intelligence tool \u00ab<a href=\"https:\/\/www.datahouse.ch\/en\/2022\/03\/09\/superset-bi-dashboard-plattform\/\" target=\"_blank\" rel=\"noreferrer noopener\">Superset<\/a>\u00bb or the R-Package \u00abShiny\u00bb.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-choosing-the-right-visualization-for-a-complex-data-set\"><strong>Choosing the right visualization for a complex data set<\/strong><\/h3>\n\n\n\n<p>Often, complex data sets contain more dimensions than our two-dimensional smartphone and computer screens can easily represent. The concept of the \u00abGrammar of Graphics\u00bb by Leland Wilkinson shows how a data set is appropriately transformed into a figure. It breaks down a data visualization into functional layers: from the raw data, to graphical elements and scales, to the coordinate system. The <a href=\"https:\/\/vita.had.co.nz\/papers\/layered-grammar.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">renowned data scientist Hadley Wickham<\/a>&nbsp;has built the well-known R package <a href=\"https:\/\/ggplot2.tidyverse.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">ggplot2<\/a> on this basis. It allows to define graphics directly over these layers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-the-grammar-of-graphics-by-means-of-an-example\"><strong>The \u00abGrammar of Graphics\u00bb by means of an example<\/strong><\/h3>\n\n\n\n<p>To understand this concept, let&#8217;s look at an example. A fictitious company operating six restaurants and four bars in Switzerland analyzes its sales in September 2022, and we also consider the years of operation. We transfer the main dimensions \u00abyears in operation\u00bb and \u00abrevenue\u00bb to the two axes and as graphic elements we choose points with location labels. The first graph immediately shows: the older, established locations generate more revenue than the newly opened stores.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:88%\">\n<div class=\"image__wrapper alignfull withoutShadow\"><figure class=\"wp-block-image alignfull size-full is-style-default withoutDescription withoutShadow\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"596\" src=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_01.webp\" alt=\"\" class=\"wp-image-3873\" srcset=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_01.webp 855w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_01-300x209.webp 300w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_01-768x535.webp 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.7%\">\n<p>The package ggplot2 allows us to add another dimension to the graph with only one additional argument. The color shows whether it is a restaurant or a bar. It seems that newly opened restaurants generate comparatively little revenue, while the new bars start better.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:88%\">\n<div class=\"image__wrapper alignfull withoutShadow\"><figure class=\"wp-block-image alignfull size-full size-large is-style-default withoutDescription withoutShadow\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"596\" src=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_02.webp\" alt=\"\" class=\"wp-image-3871\" srcset=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_02.webp 855w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_02-300x209.webp 300w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_02-768x535.webp 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.7%\">\n<p>This assumption can be confirmed with ggplot2&#8217;s function for plotting layers with statistical transformations \u2013 like regression lines in this case. Restaurants start with lower revenues, but overtake bars after a few years of operation. For restaurateurs, this is an indication that the additional investment in restaurants could pay off. By adding and changing individual layers in ggplot2, similar evaluations on other topics such as personnel costs or store space can be created with little effort.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:88%\">\n<div class=\"image__wrapper alignfull withoutShadow\"><figure class=\"wp-block-image alignfull size-full size-large is-style-default withoutDescription withoutShadow\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"596\" src=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_03.webp\" alt=\"\" class=\"wp-image-3889\" srcset=\"https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_03.webp 855w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_03-300x209.webp 300w, https:\/\/www.datahouse.ch\/wp-content\/uploads\/Sales_03-768x535.webp 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:6%\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.7%\">\n<p>The R package knows <a href=\"https:\/\/ggplot2.tidyverse.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">all relevant diagram types<\/a>, such as the heatmap shown above. The data can be scaled and transformed as desired, interactive graphics can show specific details.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-data-visualization-ggplot2-can-do-even-more\"><strong><strong><strong>Data visualization: ggplot2 can do even more<\/strong><\/strong><\/strong><\/h3>\n\n\n\n<p>Technically, with a package as comprehensive as ggplot2, there are hardly any limits. However, it is important to question whether additional information in a graphic offers added value or whether, in the worst case, interpretability suffers. Because with the \u00abGrammar of Graphics\u00bb it is like in the language: The grammar is only the first step to a good sentence \u2013 respectively to a good graphic. We at Datahouse are happy to support you in designing your personal visualization solution.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15.5%\"><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-columns alignfull is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"grid__wrapper\">\n        <div data-component=\"PostGridBlock\" data-props=\"{&quot;query&quot;:{&quot;postType&quot;:&quot;post&quot;,&quot;itemsPerPage&quot;:&quot;3&quot;,&quot;orderBy&quot;:&quot;date&quot;,&quot;order&quot;:&quot;desc&quot;,&quot;postTypeRest&quot;:&quot;posts&quot;,&quot;taxQuery&quot;:{&quot;categories&quot;:&quot;115&quot;}},&quot;title&quot;:&quot;Similar articles&quot;,&quot;postsData&quot;:[813,812],&quot;align&quot;:&quot;none&quot;,&quot;displayType&quot;:&quot;grid&quot;,&quot;displayInfo&quot;:&quot;tags&quot;,&quot;gridColumns&quot;:3,&quot;selectPosts&quot;:false,&quot;navigation&quot;:{&quot;type&quot;:&quot;none&quot;}}\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Data visualization<\/p>\n","protected":false},"author":11,"featured_media":3877,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[114,115],"tags":[],"class_list":["post-874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en","category-data-science-en"],"acf":[],"image":{"url":"https:\/\/www.datahouse.ch\/wp-content\/uploads\/TeaserBlogDataviz_en.webp"},"_links":{"self":[{"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/posts\/874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/comments?post=874"}],"version-history":[{"count":3,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/posts\/874\/revisions"}],"predecessor-version":[{"id":6521,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/posts\/874\/revisions\/6521"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/media\/3877"}],"wp:attachment":[{"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/media?parent=874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/categories?post=874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datahouse.ch\/en\/wp-json\/wp\/v2\/tags?post=874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}