Creating interactive, data visualization tools is its own reward! By learning how to create your own graphs using existing graphing software like Tableau or Microsoft PowerPoint, you can add some additional flavor to your career as an information designer or visual communicator.

There are many ways to use graphics in business. You do not need to design full-fledged infographics with pretty pictures to use them effectively. In fact, sometimes very simple, plain pictures can be just as effective (if not more so) than complex illustrations.

Businesses will always have a need for well designed marketing materials and advertisements. Using appropriate visuals and color schemes to emphasize key messages is an integral part of producing quality advertising.

Information designers and marketers know that a well designed piece of material will get noticed much more easily than one that does not. Therefore, it makes sense to learn some basic graphic designing techniques from computer programs such as Tableau or PowerPoint.

This article will go into detail about one way to achieve this by creating and editing charts using the same interface used to make presentations. These types of charts are called ggglots or ggg plots. They are made in the program called R, which stands for “relational” because you can connect any column to any row. This article will also include some tips and tricks to help you take your skills up a level.

How to use R Gallery Ggplot

r gallery ggplot

The first way to use this tool is by creating an interactive, drag-and-drop chart using ggplot(). This method allows you to easily create bar charts, line graphs, and scatter plots.

To make things easy, we will use our own data as examples in this article!

We will be making a scatter plot which uses geom_point() to add points to show where each item of our dataset lives. We will then use color and size to give some context to these points and make it more interesting. Then, we will make a bar graph with ggbar(), and we will label it. Lastly, we will make a line chart with ggline() and update the x axis to have time stamps instead.

Step one: Create your chart

Start by opening up galleryggplot.org and either creating or logging into an account. Once logged in, click Make An Interactive Chart at the top left. You can now begin designing and editing your chart!

At this stage, you can still choose what kind of chart you want to make (scatter map, line chart, etc.), but cannot edit any of the aesthetics (colors, thicknesses, shapes, etc.). Only after that is completed can you move onto the next step.

Once those two steps are done, you can start dragging and dropping elements to create your chart.

Obtaining and installing R Gallery Ggplot

r gallery ggplot

First, you will need to have Python installed. You can check that here!

Next, you will want to make sure your browser is allowed to access the Google Chrome web store. If not, you will be able to do so by clicking this link and allowing it through your software firewall or security settings.

Once everything has been allowed, head over to the R Gallery website at https://www.rgalleryggplot.com/. Press enter in your browser and you should arrive at their homepage!

You now have two ways to install RGGBOT.

Creating a data set for a ggplot2 graph

r gallery ggplot

Data sets are what most people refer to as a source of information used to create graphs or charts in graphical software such as PowerPoint, Excel, or Google Spreadsheets.

Data sets contain numerical or categorical variables that can be organized into columns and rows, respectively. Some data sets have multiple observations per row, which makes it possible to use the additional features of ggplot2 like bar plots and line graphs!

In this article we will learn how to create our own data set using the R statistical program. We will also look at some basic concepts of graphing with R including creating axis and title objects.

Creating a ggplot2 graph

r gallery ggplot

Let’s create our first interactive, data-driven plot using the ggplot2 library. We will use recipes as our dataset and cook with them by creating a scatterplot of recipe cost vs. nutrition value.

To make things easy to understand, we will organize the ingredients into categories and calculate the average nutritional value per serving for each category. Once all that is done, we can create an interaction dendogram or cluster diagram which shows how similar different ingredient types are to each other.

We will also be animating this so it is important to have a good understanding of basic animation concepts such as key frames, reverse animations, and easing. This article has some really great resources for you to check out!

For today’s project, we will be going through three steps:

Step 1 – Create the Categories

In the first step of our recipe costs analysis, we will be creating some categorical variables in order to more easily analyze the data. These will include Nutrition Values, Ingredient Names, and Unit Amounts.

Once those are created, we can begin entering our data into the form of lists and tables which we will later scale up for our recipes.

Step 2 – Calculate Nutritional Value

Next, we will take each list item and input it into a tool to determine its nutritional values. For this example, we will use the USDA Food Database which contains many nutritional information for various food products.

Understanding and interpreting ggplot2 graphs

r gallery ggplot

The second way to make plots in r is using the package ggplot2. While not as intuitive as other graphing software, such as Excel or PowerPoint, this tool does offer some pretty powerful features.

One of these tools is creating interactive, drag-and-drop graphs. This is possible by setting up your graph in a special program called ggvis. After that, you can easily add variables to be plotted against each other and create interactions between two variables!

This article will go more into depth about how to use ggvis to create interactive, drag-and-drop charts with r and python.

What are the different types of graphs in R Gallery Ggplot?

r gallery ggplot

The first type of graph you will see in this tool is called a scatter plot. A scatter plot uses two variables to show data as points or shapes, and then numbers or pictures that represent another variable.

In this case, the two variables are age and BMI, with one axis being height and the other being weight. The numbers or pictures attached to each point are estimated average health costs for someone of that age and BMI.

You can play around with these plots by changing the colors, sizes, and positionings of everything! They give you great flexibility to make comparisons.

The next type of chart you will find here is an area-bounded boxplot. These use three dimensions – time, place, and quantitative value. In this example, it’s year, state, and medical cost.

A boxplot shows median, mean, upper quartile, lower quartile, and outliers for all states at every year studied. You get a sense of how spread out the values were throughout time in individual states, and if there were any significant shifts in value across states or years.

The last type of chart you will find here is a bar chart. Bar charts only have a single dimension like year or state, but they combine those values into one vertical column. This makes it much easier to compare just like with a table.

How to use the different graphs in R Gallery Ggplot

r gallery ggplot

The first way to use these interactive charts is by creating an account at rogerschwimmer.com/ggplot2/. Once you have this profile, you can pick any chart within the site and edit it!

You do not need to be logged into your computer using a web browser to access the content on rogerchwimmersorg ggplot2. You can create an account anywhere that uses google accounts or facebook accounts, for example here on our website!

Once you have created this account, then you can easily re-create any of the charts we talked about above. Simply log in and choose one of the charts to explore. Enjoy editing the chart and exploring other features!

Anyways, hope you enjoyed the article! Leave a comment below and let us know what you think.

How to modify a ggplot2 graph

r gallery ggplot

Modifying a ggplot2 plot is easy, just use the methods mentioned above or create your own!

The easiest way to do this is by using the layer argument in `ggplot().` This allows you to add other layers to the plot such as geom_text(), color schemes for the lines and points, etc.

You can also easily remove any of these components from the chart by setting their Boolean value to false. For example, if you wanted to remove the legend, set it to FALSE. If you want to change the colors used for the line, points, and axes, then do that as well.

This article will show you how to quickly make some changes to the below-generated plot. Changes include adding text, changing axis labels, and altering the grid background and padding. All of these things are done through the layer argument within the main ggplot() function.

If there’s anything you’re struggling with, feel free to check out our collection of interactive plots at https://www.teachersteachguide.com/interactive-charts-grids/.