search for: geom_points

Displaying 20 results from an estimated 483 matches for "geom_points".

Did you mean: geom_point
2010 Feb 14
2
Problems with boxplot in ggplot2:qplot
Dataframe closed contains balances of closed accounts: each row has month of closure (Date-type column month) and latest balance. I would like to plot by-month distributions of balances. A qplot call below produces several warnings and no output. Can anyone help? Thank you. PS. A really basic task, very similar to the examples on p. 71 of the ggplot2 book, apart from a Date grouping column; I
2020 Oct 21
2
AES spesification
Dear I use dataset , as called "mpg" This is code ggplot(data=mpg)+ geom_point(mapping = aes(x=displ, y=hwy, colour=year)) But I would like to see only "year of 1999" in this relationship between x and y variables How could I change the code in this direction? I found the following code library(dplyr)year_1999 <- filter(mpg, year=="1999")ggplot(year_1999,
2011 Aug 15
1
ggplot in a function confusion!
Whats going on here? df<-data.frame(x=1:10,y=1:10) ggplot()+geom_point(data=df,aes(x=x,y=y)) ## this is the normal usage right? ggplot()+geom_point(data=df,aes(x=df[,1],y=df[,2])) ## but I can also feed it column indices ggplot()+geom_point(aes(x=df[,'x'],y=df[,'y'])) ## or column names. ## but if i wrap it in a function... plot.func.one<-function(dff,x.var,y.var){
2013 Apr 25
1
problem with geom_point in ggplot using a different column
I want to draw boxplot where the geom_points are displayed based on "ERBB2.MUT" subset and they should be displayed in the right box (based both on the "ERBB2.2064" field and "ERBB2_Status"). However, given my command I currently only see "red" points corresponding to "MUT" subset in one stra...
2010 Apr 07
1
ggplot2, density barplot and geom_point layer
Hi, Please consider the example below. How can I manage to overlay the points the way I want in the second case? Thanks, Joh library(ggplot2) # Modify data to match "real" case myDiamonds <- diamonds myDiamonds[["clarity"]] <- as.character(myDiamonds[["clarity"]]) myDiamonds[myDiamonds[["clarity"]]=="I1","clarity"] <- 1
2012 Jan 16
1
ggplot- using geom_point and geom_line at the same time
Hi I am plotting line chart using ggplot and want to use geom_line and geom_point simultaneously. I get the plot but now I have two legends. None of the legend is representing the true values. I need the legend with shape and color both. Thanks > con = textConnection("inputs var1 var2 var3+ 100 10 5 2+ 1000 20 10 4+ 5000 30 15 8+ 10000 40 20 16+ 30000 50 25 32")> data =
2017 Jun 16
2
point size
Hi all; I am running the following ggplot codes. Runs well. However, I need to reflect the numeric values of the log10_P to the point size in the graph. Your help highly appreciated, Regards, Greg p <- ggplot(mydata, aes(x = X, y = log10_P)) + theme_bw() +theme(panel.border=element_blank()) + theme(legend.position="top", axis.text=element_text(size = 8)) (p1 <- p +
2017 Aug 25
2
about multi-optimal points
Hi R users, I have some sets of variables and put them into one dataframe, like in the following. How to choose a specific set of pareto front, such as 10 from the current datasets (which contains more than 100 sets)? And how to show the 10 points on one figure with different colors? I can put all the points on one figure though, and have the code below. I drew two ggplots to show their
2017 Jun 16
0
point size
You could add size = log10_P to the aes() inside geom_point(). Untested code below. See also http://ggplot2.tidyverse.org/reference/geom_point.html ggplot(mydata, aes(x = X, y = log10_P)) + theme_bw() + theme(panel.border=element_blank(), legend.position="top", axis.text=element_text(size = 8)) + geom_point(aes(color = Traits, size = log10_P)) Jean On Fri, Jun 16, 2017 at
2017 Aug 26
0
about multi-optimal points
HI lily, for the colouring of individual points you can set the colour aesthetic. The ID is numeric so ggplot applies a colour scale. If we cast ID to a factor we get the appropriate colouring. test_df <- data.frame(ID = 1:20, v1 = rnorm(20), v2 = rnorm(20), v3 = rnorm(20)) ggplot(data=test_df, aes(x=v1,y=v2, colour = as.factor(ID))) + geom_point()+ theme_bw()+ xlab('Variable 1')+
2011 Apr 03
1
another question on shapefiles and geom_point in ggplot2
Manuel: I changed your variable names from x to 'long' and y to 'lat' on the riqueza_out.csv file. The code below should do what you want. Also, since the legend title is kind of long, I broke it down into three lines so you can see more plot area. I am cc'ing the other groups so more people use it if needed. library(rgdal) library(ggplot2) library(sp) library(maptools)
2011 Dec 23
1
ggplot2: behaviour with empty datasets
For example, prepare like this > df.0 <- data.frame(x = 0, y = 0, note = "1") > df.1 <- subset(df.0, note == "1") > df.2 <- subset(df.0, note == "2") Then a call to > ggplot() + aes(x = x, y = y) + > geom_point(data = df.1) + geom_point(data = df.2) produces the error > Error in eval(expr, envir, enclos) : object 'x' not found
2010 Nov 04
5
ggplot output
Dear All, I have this script: dat <- data.frame(Month = hstat$Date,C_avg = hstat$C.avg,C_stdev = hstat$C.stdev) ggplot(data = dat, aes(x = Month, y = C_avg, ymin = C_avg - C_stdev, ymax = C_avg + C_stdev)) + geom_point() + geom_line() + geom_errorbar() dat <- data.frame(Month = hstat$Date,K_avg = hstat$K.avg,K_stdev = hstat$K.stdev) ggplot(data = dat, aes(x = Month, y = K_avg,
2023 Oct 30
1
Missing shapes in legend with scale_shape_manual
Hello, I'm trying to plot a graph of blood glucose versus date. I also record conditions, such as missing the previous night's medications, and missing exercise on the previous day. My data looks like: > b2[68:74,] # A tibble: 7 ? 5 Date Time bg missed_meds no_exercise <date> <time> <dbl> <lgl> <lgl> 1 2023-10-17 08:50
2009 Jul 23
1
ggplot2 : commands on one line vs two lines.
I have just started using ggplot2 and I seem to be doing something stupid in writing ggplot2 commands on more than one line. In the example below the commands on one line are working fine, but as soon as I put them on two lines I get an error. Can any one point out what I am doing wrong? It must be something blindingly simple. Thanks Example
2008 Sep 22
2
adding layers in ggplot2 (data and code included)
Here is some sample data: mydata <- read.table(textConnection("Est Group Tri 0 0 4.639644 1 0 4.579189 2 0 4.590714 0 1 4.443696 1 1 4.588243 2 1 4.650505 0 2 4.296608 1 2 4.826036 2 2 4.765386"),header=TRUE); closeAllConnections(); I can form two plots,
2012 Jul 02
5
ggplot: dodge positions
Dear all, I want to get a series of boxplots (grouped by two factors) and I want to overlay the original observations and the following code does almost what I want: library(ggplot) ddf <- data.frame(x=factor(rep(LETTERS[1:4], each=30)), y = runif(120,0,10), grp = factor(rep(rep(1:3, 10), 4))) ggplot(ddf, aes(x, y, colour=grp)) + geom_boxplot() + geom_point() Yet the position of the points
2008 Sep 10
1
ggplot2: edge outlines on points
The graphic design elements in ggplot2 are so well done for color graphics. Thank you! For BW publication graphs, there are a few options I would like to be able to tweak, but can't seem to find the grob handles necessary OR the right plotting strategy. Here's one problem I've been puzzling over: Q> How do you plot points with a grey fill and a black outline around the
2023 May 12
2
Newbie: Controlling legends in graphs
Hello, I'm trying to create a line graph with a legend, but have no success controlling the legend. Since nothing I've tried seems to work, I must be doing something systematically wrong. Can anyone point this out to me? Here's my data: > weights # A tibble: 1,246 ? 3 Date J K <date> <dbl> <dbl> 1 2000-02-13 133 188 2
2008 Sep 25
1
ggplot: adding layer using different data, groups and also controlling appearance
I have a more complicated function I am trying to write, but I run in to a problem when I want to add something to the plot from more than one data set while simultaneously controlling the appearance of the additional layer. # Toy data: foo <- data.frame ( x = 1:4, y = 4:1 , membership = c( "A", "A", "B", "B" ) ) bar <- data.frame ( x = 1:4 + 1 , y