Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
68 views

Is there any way to get around ggplot2 minimum size for geom_points? Ie here: ggplot(df, aes(x = umap_1, y = umap_2, color = Protocol)) + rasterise(geom_point(size = 0.0001), dpi = dpi) + labs(x = ...
RJVV's user avatar
  • 105
3 votes
1 answer
126 views

I am trying to create a ggplot point plot where both fill and shape are defined by additional variables. When I add shape to the aesthetic, the fill color disappears from the legend. How do I get the ...
BenW's user avatar
  • 177
0 votes
0 answers
90 views

I want to fill only the top half or the bottom half, as shown below: x= c(10, 20, 30, 40, 50, 60) y= c(100, 150, 200, 220, 230, 245) group= c("I", "I", "I", "II"...
J.K Kim's user avatar
  • 964
0 votes
0 answers
53 views

HCI Graph I am trying to highlight a group of countries among others. In particular, I want to highlight countries that are important markets to the US in Africa, while fading the others into the ...
AdamG66's user avatar
0 votes
1 answer
53 views

I am trying to create a plot in R ggplot2 where my data (see below) has multiple outcomes. For each outcome there are 5 possible methods that need to be plotted (although some are NA and should leave ...
user5481267's user avatar
0 votes
2 answers
61 views

I am generating boxplot overlayed with geom_points.For some of the geom_points, I see kind of halo/background around the point (See under the red and blue boxplots). What am I doing wrong and how can ...
Swati Puranik's user avatar
0 votes
1 answer
46 views

How can I sort Fuel in this chart by value_out.net i.e. the net values marked as black dots? Please see the figure, and the code below: fuels_out_plot_w_tot_order <- ggplot() + geom_bar(data = ...
Paul's user avatar
  • 21
0 votes
1 answer
36 views

I've added median lines to my geom_point and asked to attach labels to the right of them via hjust = -1.5. However, the label of the fourth level is misaligned, sitting a lot further to the right of ...
Louis Talay's user avatar
1 vote
1 answer
68 views

I have plotted concentrations of phosphate at their respective sampling sites. However, I have three different depths at which phosphate was measured. Can I make the geom points a particular size to ...
Leanne's user avatar
  • 11
1 vote
0 answers
44 views

Creating a box plot in R using ggboxplot. Using geom_point to add individual data points and position = position_jitter(width = 0.2)) to spread them out. The generated plot consistently adds an extra ...
Andrew Tilley's user avatar
0 votes
0 answers
48 views

Here is the plot I have, the data & the code ggplot(data = TI, aes(y = VM, x = GeoM)) + geom_point() + geom_errorbar(mapping = aes(xmin = L95, xmax = U95), width = .75) + geom_vline(aes(...
user26398718's user avatar
1 vote
2 answers
98 views

LATER EDIT: I finally figured out how to do it. It works with the following code: legend_size <- c(6,5,4,3,2,1,0,1,2,3,4,5,6) tt <- data.frame(x = c(27.9656, 27.1704, 26.2128 ,23.5634 ,25.3528 ...
Alex.V's user avatar
  • 65
1 vote
1 answer
59 views

When I made a plot using geom_point() and geom_line(), a few values in the middle didn't appear and I can't figure out why. I have a dataframe with 3 columns (K_value, CV_error, and Run), where ...
Katherine Drotos's user avatar
1 vote
1 answer
48 views

I'm using ggplot2 to create a lollipop graph comparing US university tuitions and median household income (for all races and also for black households specifically). For the graph to be easier to read,...
Mac's user avatar
  • 13
0 votes
0 answers
211 views

I am building a simple map with 3 points that I want to have different symbols but when I try to change the shape by group manually I get an error about shape aesthetics. First a map: library(ggplot2) ...
scrletbgonia's user avatar
0 votes
1 answer
395 views

I am trying to plot a sort of bubble plot but i am unable to set the size of the dots and have a legend explaining how the sizing works. These are two examples which combined give me the expected ...
gsd's user avatar
  • 837
0 votes
1 answer
53 views

I am trying the following code to make a heat map using ggplot library(RColorBrewer) color_palette <- brewer.pal(9, "Spectral") ggplot(df, aes(x=x, y=y)) + geom_point(aes(color=...
Sudoh's user avatar
  • 370
0 votes
0 answers
45 views

I'm working on my first R Shiny application, specifically for customizable graph outputs. I'm looking for an input function similar to colourInput() from the colourpicker package, but which will ...
David Ross's user avatar
1 vote
1 answer
227 views

I need help in producing a vertical line that can separate my character groups in a geom_point graph using ggplot. A simplified example is below. Ultimately, I want to produce a line that sits evenly ...
Sarah Lou's user avatar
1 vote
1 answer
665 views

The problem i am having is surely trivial, and yet i am unable to solve it. What i need is to have my own shape, colour, and size for the geom_point(). However, if i set it, the size of the symbols in ...
gsd's user avatar
  • 837
0 votes
1 answer
83 views

I am trying to plot a 5x6 numeric vector using ggplot and geom_point (after converting the vector to a dataframe), but I can't figure out the aes mappings to make the plot correctly. I think I am ...
jonathanl86's user avatar
0 votes
0 answers
65 views

I'm generating a simple geom_point plot with R ggplot2: library(dplyr) library(ggplot2) set.seed(1) df <- matrix(runif(16, 0, 10), nrow = 4, ncol = 4, dimnames = list(paste0("R", 1:4), ...
dan's user avatar
  • 6,342
1 vote
1 answer
124 views

I would like to add within the scale_shape_manual() of a ggplot a smiley face for a given category, but simple, so exactly as ":)". However, I can only find an actual emoji (e.g. here or ...
mto23's user avatar
  • 489
0 votes
1 answer
682 views

I have a table I read into R to plot with ggplots. I need to plot two sets of data points and also use an ifelse condition to be able to show specific genes. I would like to show a legend to the plot, ...
Assa Yeroslaviz's user avatar
0 votes
1 answer
164 views

The spaces between two dots are vary, some are very far, and some are very narrow. And also, the order between two dots is likely random (Some are "non-transplan" are in the left, some are ...
Gita Alisa's user avatar
0 votes
2 answers
44 views

I want to make a conditional geom_point , where sids that are x in the data are marked for example by a cross in the point or alternative outline color. Note that I don't want to add additional ...
MoonS's user avatar
  • 185
0 votes
1 answer
542 views

I want to use different degrees of fill in the shape circle to represent different variables in my data set. I have a column in my data set called 'shape' that has numbers 0,1,2,3 that correspond to ...
Mossed's user avatar
  • 1
0 votes
1 answer
22 views

In my dataset below, I have a column (z) that I would like to plot by x and y. I dont want to plot all the z values though, only the first one for each line. In the first figure, you can see that ...
L55's user avatar
  • 215
1 vote
1 answer
106 views

I have a dataframe called pollen_agg.Here is its structure with dput(pollen_agg): pollen_agg <- structure(list(taxa = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L), ...
Melissa Duda's user avatar
0 votes
0 answers
86 views

I'm creating the following fill, color, and size coded plot in R's ggplot2's geom_point: Example dataset: library(dplyr) library(ggplot2) set.seed(1) levels.mat <- matrix(data = runif(7*6, 1, 3), ...
dan's user avatar
  • 6,342
0 votes
1 answer
107 views

I'm trying to create an R ggplot2 geom_point plot where the points are gradient filled according to a numeric value, sized according to a numeric value, and border colored according to a boolean value....
dan's user avatar
  • 6,342
0 votes
1 answer
75 views

I was looking to plot some points colored following 2 variables and overly colors. thanks to this post, I have a close result like below library(ggplot2) data=data.frame(x=1:4,y=1:4,var1=c(1,0,0,1),...
Wael's user avatar
  • 1,808
1 vote
1 answer
79 views

Having completed my regression equation and F-statistic I have been able to plot a regression curve with confidence limits through my set of data points which I am happy with. My x variable is number ...
Roger Frost's user avatar
1 vote
1 answer
33 views

I am new to using R and I am sure there is a simple solution to this but having tried multiple methods and watched quite a few videos I wondered if someone could help give me some advice on this. I ...
J Cornish's user avatar
2 votes
1 answer
63 views

I am trying to color-code points on a geom_point plot to mirror team colors of major league baseball teams (e.g. New York Mets would have a blue-filled point with an orange border). There are similar ...
Violin125's user avatar
  • 163
0 votes
1 answer
68 views

I have a data frame with 3 columns and I would like to plot every column versus the other column with geom_point. I am aware of ggpairs function but I would like to do this using regular geom_point(). ...
say.ff's user avatar
  • 395
0 votes
1 answer
438 views

I'm stumped as to why my points are incorrectly coloured. I have set my own colour palette and used this to define the colours of the geom_point() but the colours that are actually being plotted are ...
willpkay's user avatar
1 vote
2 answers
1k views

I had a similar problem as in this post , and the solution almost worked for my data, but I'm having problems to connect the points to the lines when I add jitter. I addeded jitter to the geom_point (...
banzecoleco's user avatar
1 vote
2 answers
60 views

This is likely trivial, but how can I: Apply labels to each modelnum value on the y axis? Could just be named "Label1" for "a", "Label2" for "b" or something ...
a_todd12's user avatar
  • 664
0 votes
1 answer
2k views

pretty much what it says. i cant seem to create my scatterplot with the code that my prof basically hand fed to us ggplot(df1, aes(mean, y)) + geom_point() + geom_errorbar(aes(ymin = lwr, ymax = upr, ...
Elexis H's user avatar
2 votes
1 answer
203 views

I have a dataframe the looks as follows: COUNTRY YEAR y AT 2019 25 AT 2020 38.0 AT 2021 23.4 BE 2019 11.1 BE 2020 18.6 BE 2021 15.0 DK 2019 ...
Bob's user avatar
  • 516
0 votes
1 answer
35 views

I am trying to create a dendrogram that conveys separate information with the label and geometry points. However, the code that I have written to make the aesthetic for the points at the end of the ...
Dean Bayliss's user avatar
0 votes
1 answer
57 views

Hi there I have a very simple problem I think, but I'm not sure how to fix it. Basically, I have a geom_point plot where I have two approaches used and I wish to both differentiate shapes and colors ...
Matteo's user avatar
  • 537
0 votes
0 answers
58 views

EDIT: Stack said my question is very similar to this one (Combine legends for color and shape into a single legend) but that person wanted to join two legends in one and I just want the wrong one to ...
Karina Ramos's user avatar
0 votes
0 answers
68 views

I am trying to add city points and labels to a ggplot2 map, and when I add a geom_point() layer to the map with a specified points drawn from a newly created dataframe with specified latitude and ...
Hannah Early's user avatar
0 votes
1 answer
96 views

Context: I'm using R on RStudio to make, out of a .csv file (meu_primeiro_csv), a basic ggplot(); this .csv file was imported using read_csv(), and I manually entered the type of each column using ...
BsAxUbx5KoQDEpCAqSffwGy554PSah's user avatar
1 vote
1 answer
34 views

Let's say I have this plot illustrating some odds ratio from a main analysis: Unfortunately, the geom's are overlapping and it is difficult to see the full range of the confidence interval. ggplot(df,...
cmirian's user avatar
  • 2,263
1 vote
1 answer
850 views

I'm trying to add the datapoints using geom_point() to the plot_model() that is showing the linear relationship between the age and left.LGN variables. plot <- plot_model(m1, terms = c("age&...
ale98's user avatar
  • 11
0 votes
0 answers
108 views

I have the following graph (below) that I would like to add a trend line to. However, I am having the same issue as this person has previously outlined: geom_smooth in ggplot2 not working/showing up. ...
Bob_123's user avatar
0 votes
0 answers
32 views

I get an error in the group option: ! Problem while computing aesthetics. ℹ Error occurred in the 2nd layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as ...
LearningR's user avatar

1
2 3 4 5 6