Skip to main content

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
0 votes
1 answer
47 views

I am looking for learning material for R (including base R & tidyverse approaches (with a focus on readr, dplyr & tidyr)) and data visualisation using ggplot2 library for commercial teaching ...
Hamideh's user avatar
  • 942
0 votes
1 answer
141 views

In ggplot2 package documentation for geom_freqpoly, there is a formula in the last example which use a function to dynamically ...
rez's user avatar
  • 113
0 votes
1 answer
6k views

I have an issue with the "ggplot2"-package, where I cannot get the linetypes in the legend. The legnd only shows the color of each line, but not the specific type. My code looks like: <...
AndersMax's user avatar
1 vote
1 answer
582 views

I made the following contingency table already, however there should only be TRUE or FALSE and not all of them showing up on the table. How can I change that? my code is the following: ...
Bert's user avatar
  • 25
1 vote
0 answers
82 views

I'm studying PCA method with the package PCAmixdata because I have a dataset with numerical and categorical variable. This is my example code in R: ...
Inuraghe's user avatar
  • 491
0 votes
1 answer
3k views

Context: I am trying to change the legend labels for the Indices variable which contains "Positive" and "Negative" in "d_posneg" data frame. Problem: However, my ...
n.baes's user avatar
  • 39
2 votes
0 answers
481 views

I am new to R. While working on my university assignments, I found that legends for Base R plot do not show correct information, hence I switched to ggplot2 wherever legends were needed. I observed ...
Vanjuli's user avatar
  • 21
1 vote
1 answer
62 views

I have a data.frame that have two cols, $x=mz$ and $y=res$. There are about ~2 million rows in the DF. When I plot the graph I get the below. What I'd like to do is ...
V. Lad's user avatar
  • 11
1 vote
1 answer
209 views

I have made a cluster analysis and ended up with dendrogram; however the row names are not readible (made a red rectangle). May I ask if there is way to adjust it? ...
Lola Kpiani's user avatar
1 vote
1 answer
172 views

I would like my ggplot to display the state I had selected for better clarity but it seems like glue is only seeking for the first observation rather than my desired output. ...
zher4883's user avatar
0 votes
1 answer
2k views

In my dataset, I have two numeric revenue features, one for each month, and two categorical features one for region and other for value segment. what I want to do is compare these two revenues col by ...
Ehsno's user avatar
  • 3
0 votes
1 answer
2k views

I am trying to plot a box plot with the Trinucleotide as the x axis (so 64 trinucleotides on the x axis) and the frequency of each trinucleotide in each of 6 samples then color code the plot according ...
user14687500's user avatar
1 vote
1 answer
669 views

So I'm trying to create a simple bar chart of Survive vs Not Survive for the common Titanic data set in R. I keep getting just the number of No's and Yes's, and not the frequencies or counts ...
redfish993's user avatar
1 vote
1 answer
2k views

I am working with single time-series measurements that I want to plot for the time window of about 1 week. This is the data I am working with. This is my R script: ...
Livingsten's user avatar
2 votes
0 answers
867 views

I added r2 value and the formula of the regression function but I also want RMSE value on my plot, maybe I need to add something but I could not see a proper answer to this question neither here nor ...
RS_girl's user avatar
  • 21
2 votes
1 answer
434 views

I have tried generating higher quality of data visualization plots from RStats. I tried increasing frame dimensions but it's still max at about ~350kb. How do I generate higher quality images from ...
BioIsaac's user avatar
1 vote
1 answer
65 views

I'm facing a data framework with ~ 20 k observations and 151 variables across 2078 subjects At first I am primarily interested in how the data looks like related to a single parameter. But I cannot ...
Ben's user avatar
  • 570
3 votes
1 answer
537 views

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. ...
user208145's user avatar
1 vote
1 answer
181 views

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 ...
Jie's user avatar
  • 187
2 votes
1 answer
301 views

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 ...
The Great's user avatar
  • 2,775
0 votes
1 answer
95 views

My data is about boardgames which contain 1 to many catgeories each like this : ...
thoms's user avatar
  • 1
2 votes
3 answers
79 views

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 ...
Lutz's user avatar
  • 121
2 votes
1 answer
5k views

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 ...
Ayush Ranjan's user avatar
0 votes
0 answers
6k views

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 ...
DataGuy23's user avatar
5 votes
1 answer
53k views

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 ...
Fredrik's user avatar
  • 1,047
1 vote
2 answers
339 views

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 ...
Kota_K's user avatar
  • 35
0 votes
1 answer
722 views

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 ...
Slyme's user avatar
  • 3
1 vote
1 answer
209 views

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. ...
3nomis's user avatar
  • 541
3 votes
1 answer
277 views

How can I plot the histogram below, using ggplot (R) and/or matplotlib (...
Learner132's user avatar
1 vote
1 answer
541 views

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 ...
Matthew Ciaramitaro's user avatar
0 votes
2 answers
4k views

I am using ggplot, to compare 114 unique studies for a particular variable I'm interested in. This is what I have used. ...
Shivy b's user avatar
  • 11
3 votes
2 answers
4k views

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 ...
SKOR2's user avatar
  • 33
-1 votes
2 answers
164 views

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 ...
Dominykas Tunaitis's user avatar
1 vote
0 answers
33 views

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. ...
renakre's user avatar
  • 111
4 votes
1 answer
2k views

I have data frame having 3 columns namely index, Actual & Predicted (all column are numeric). I am using 2 packages plotly & ...
Manik's user avatar
  • 439
1 vote
0 answers
53 views

I'm plotting fluctuations in a trinomial distribution across two dimensions. ...
enfascination's user avatar
3 votes
1 answer
1k views

I have two probability distribution curves, a Gamma and a standarized Normal, that I need to compare: ...
JulioSergio's user avatar
0 votes
1 answer
199 views

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 ...
Vamsi Krishna's user avatar
2 votes
2 answers
11k views

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 ...
Ashok Kandipati's user avatar
0 votes
1 answer
3k views

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, ...
Andis's user avatar
  • 111
-2 votes
1 answer
535 views

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 <...
dev93's user avatar
  • 105
6 votes
2 answers
743 views

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 ...
Haroon Lone's user avatar
11 votes
2 answers
3k views

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 ...
Shahin's user avatar
  • 271
4 votes
1 answer
257 views

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 ...
user3720596's user avatar
1 vote
1 answer
2k views

Source: https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip Here is my data prep. ...
Drj's user avatar
  • 427