Questions tagged [ggplot2]

ggplot2 is an actively maintained open-source chart-drawing package for R, written by Hadley Wickham, based upon the principles of "Grammar of Graphics". It partially replaces R's basic plot and the lattice package, while providing a clean, powerful, orthogonal and fun API.

Filter by
Sorted by
Tagged with
10
votes
2answers
2k views

ggvis vs. ggplot2+Shiny; which one to choose for interactive visualization?

There is a similar question here in CrossValidated, and I have read the answers. My question is a bit different. I don't want to merely visualize my data, and indeed what I want to visualize is not ...
6
votes
2answers
591 views

Represent time-series data in much compact form

I have time series data of one month plotted day-wise as Notice every day follows a different pattern. Now, I want to show this "diversity in pattern" of each day in much compact form in a ...
4
votes
1answer
1k views

R recommendations while applying ggplot2 and plotly together to plot a graph

I have data frame having 3 columns namely index, Actual & Predicted (all column are numeric). I am using 2 packages plotly & ...
3
votes
2answers
2k views

When Should I Use ggplot2 Instead of Tableau? [closed]

I am a student getting started with Tableau for the first time. My proficiency with ggplot2 is intermediate. I can create custom versions of the most popular kinds of charts in ggplot2 but nothing too ...
3
votes
1answer
66 views

Adding a trend line or horizontal mean±stdev lines in facet_grid view

Today was the final day for an On Demand event I adminned. We got some data back from the provider today. Vendors bought in at different tiers, and only one T1 was allowed because they're a sponsor. ...
3
votes
1answer
176 views

R: lattice equivalent of density2d in ggplot?

What would be the equivalent of geom_density2d in lattice? In essence I'm trying to create this graph with lattice: I don't think contourplot or levelplot is what i want and when trying it, it gives ...
3
votes
1answer
985 views

How to plot two distribution curves in a faceted way in R/ggplot2?

I have two probability distribution curves, a Gamma and a standarized Normal, that I need to compare: ...
2
votes
1answer
167 views

ggplot (in R)/matplotlib (in Python) with linear model?

How can I plot the histogram below, using ggplot (R) and/or matplotlib (...
2
votes
1answer
23 views

How to visualize categorical data with numeric columns

I have data like as shown below I would like to represent the above tabular data in a visual form. However, the below graph may not work because my real data as 50K unique drug names. So, is there ...
2
votes
3answers
36 views

An appropiate data visualization?

I want to include a plot in my thesis to highlight regional differences in bicycle collision outcomes. Now there are several plot visualizations I could use, and I am not sure which one could be the ...
1
vote
2answers
55 views

R: Producing multiple plots (ggplot, geom_point) from a single CSV with multiple subcategories

I have a collection of bacteria data from approximately 140 monitoring locations in California. I would like to produce a scatterplot for each monitoring location with the Sampling Date on the Y-axis ...
1
vote
1answer
1k views

Manage x-axis using ggplot()

Source: https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip Here is my data prep. ...
1
vote
1answer
175 views

Mirror column plot with different y-axis in ggplot

I am trying to convert this plot Into a mirror column plot I have two datasets: school_purchases recent_school_shootings I am not very experienced with visualisation but this is my approach ...
1
vote
1answer
12k views

How to plot multiple columns with ggplot in R?

I do have a data frame with different categorical and numerical columns with the following schema: Id | num_col_1 | num_col_2 | num_col_3 | cat_col_1 | cat_col_2 ...
1
vote
1answer
170 views

How to make a Power Spectral Density Plot in R

I have a time series point process representing neuron spikes. I have computed and plotted autocovariance using acf but now I need to plot the Power Spectral ...
1
vote
1answer
50 views

Display a subset of classes in axes in ggplot

I have the following plot, is there any way in ggplot to display just the numbers 1 to 10 instead of all of them? Numbers from 10 and after are not so important, but I need to display the ones before. ...
1
vote
0answers
27 views

Visualising 2-step sequence data to spot the differences among two different user groups

I have the following data frame for a certain user group. Basically, it shows the current page, and the previous page visited across all users. For example, 81 users come from BLQ2_2 to visit BLQ2_1. ...
1
vote
0answers
46 views

Infoviz for multinomials: miniature plots within plots in R's ggplot

I'm plotting fluctuations in a trinomial distribution across two dimensions. ...
0
votes
2answers
8k views

How to summarize(add) a column according to same year and plot in R?

I have following type of data. But I would like to have graph with X-axis as Year and add all the sales added up in that year on Y- axis. The Data frame name is salesdata. I have nearly 8000 rows of ...
0
votes
1answer
28 views

How to create a barplot using multiple column [closed]

My data is about boardgames which contain 1 to many catgeories each like this : ...
0
votes
1answer
37 views

Y-axis output is not order

I am currently attempting to output some data based on user agent strings. The strings are too messy to place into a plot similar to the one shown below, so I plotted their index instead. Why is my ...
0
votes
1answer
179 views

Interactive Data Visualisations

So I have finally gotten a hold of ggplot2 and ggvis packages and tried out shiny too to have interactive graphics and visualizations. but i have been using Power BI before and came to R as a an good ...
0
votes
1answer
41 views

Data visualization on three factors

I have three factors, Income(from source A),continuous variable Income(from source B), continuous variable Happiness index,continuous variable Suppose I have 500 samples. My goal is to show the ...
0
votes
0answers
263 views

Overlay Bar Plot

I am trying to turn the first overlay bar plot into the second which allows for comparison of 2 variables instead of just one. Included my current code below which creates the first chart comparing ...
0
votes
2answers
2k views

How to plot using facet_wrap, over multiple pages as a .pdf files in r cran

I am using ggplot, to compare 114 unique studies for a particular variable I'm interested in. This is what I have used. ggplot(steps, aes(x=factor(edu))) + geom_bar(aes(y = (..count..), group = ...
0
votes
1answer
2k views

Python: ggplot geom_histogram() binwidth or bin parameter missing?

I am unable to change number of bins when using geom_histogram() function. There is nothing in the documention, except some examples where binwidth=X is used (which is how R:ggplot2 uses it). However, ...
-1
votes
2answers
71 views

Two quantities visualization

I have a problem figuring out how to visualize two simple quantities using R. I want to compare their size by visualizing two proportional spatial figures next to each other and the size proportional ...
-2
votes
1answer
372 views

How to get 2D-Array of boxplots without the diagonal with R (python also accepted)?

I want to do comparison between different factors with box plots. One factor doesn't compare with it self. So I need a matrix of boxplots (wich I could get using <...