similar to: help with ggplot2 -- ggpoint function missing?

Displaying 20 results from an estimated 20000 matches similar to: "help with ggplot2 -- ggpoint function missing?"

2017 Jun 29
1
Changing ggplot2 legend key/title to custom text
Hi Petr and thanks for your reply, That's the problem I don't want to modify the labels of my legends but the title of the legend in itself inserting my custom text :) Take for example the 1st graph in this tutorial http://www.sthda.com/english/wiki/ggpubr-r-package-ggplot2-based-publication-ready-plots I want to change the "sex" in "sex subscript 2" or "
2012 Feb 04
1
GGPLOT2: Distance of discrete values of from each end of x-axis
Hi Group, I have been working with the code below. Everything seems to work okay, except that the discrete values on the x-axis are far from each end of the graph. I've tried several things including changing the discrete values and playing with the limits, but can't get it to work. I tested this on simulated data and do not have the same problem, so I guessing it is how I'm
2010 Jun 07
1
Patch for legend.position={left,top,bottom} in ggplot2
Hi Hadley and everyone, here's a patch for ggplot2 that fixes the behavior of opts(legend.position={left,top,bottom}). If you try the following code in an unmodified ggplot2 options(warn = -1) suppressPackageStartupMessages(library("ggplot2")) data <- data.frame( x = c(1, 2, 3, 4, 5, 6), y = c(2, 3, 4, 3, 4, 5), colour = c(TRUE, TRUE, TRUE, FALSE, FALSE, FALSE))
2017 Oct 08
2
how to overlay 2d pdf atop scatter plot using ggplot2
Note: I have posted this on SO also but while the question has been upvoted, there has been no answer yet. https://stackoverflow.com/questions/46622243/ggplot-plot-2d-probability-density-function-on-top-of-points-on-ggplot Apologies for those who have seen it there also but I thought that this list of experts may have someone who knows the answer. I have the following example code:
2011 Oct 18
3
Ordering of stack in ggplot (package ggplot2)
I'm trying to reproduce the 3rd graph on the page of this site: http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However, the data below produces a ggplot with the stacks sorted in alphabetical order from the bottom up. I'd like the stacks to be in the order "Europe", "Asia", "Americas, "Africa", "Oceania". Is there an easy way to
2008 May 27
1
label outliers in geom_boxplot (ggplot2)
Dear List and Hadley, I would like to have a boxplot with ggplot2 and have the outlier values labelled with their "name" attribute. So I did > library(ggplot2) > dat=data.frame(num=rep(1,20), val=c(runif(18),3,3.5), name=letters[1:20]) > p=ggplot(dat, aes(y=val, x=num))+geom_boxplot(outlier.size=4, outlier.colour="green") >
2009 Mar 25
2
[ggplot2] Densityplot, grouping and NAs
Dear all, I do not fully understand how ggplot2 handles NAs. See the following example: library(ggplot2) x <- rnorm(150) g <- as.factor(c(rep(c(0,1,NA),50))) mydf <- data.frame(x,g) m <- ggplot(aes(x = x, group = g, color = g), data = mydf) m + geom_density() How do I get rid of the NAs (i.e. the blue colored curve)? I thought ## m <- ggplot(aes(x = x, group = g, color = g,
2017 Jun 29
0
Changing ggplot2 legend key/title to custom text
Hi There are plenty of examples https://stackoverflow.com/questions/6202667/how-to-use-subscripts-in-ggplot2-legends-r https://stackoverflow.com/questions/19507742/using-expressionpaste-to-insert-math-notation-into-a-ggplot-legend which you can modify. If you say "but it wont' seem to work" how can we know what does it mean? Plotmath expressions are rather tricky, especially if
2011 Nov 15
2
break error bars in ggplot2
Hello, i use ggplot to plot some measures including CIs as horizontal errorbars. I get an error when the scale limits are narrower than the boundaries of the error bar and hence the CIs are not plotted. library(ggplot2) df <- data.frame(resp=c(1,2), k=c(1,2), se=c(1,2)) ggplot(df, aes(resp,y=k)) + geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se)) +
2017 Oct 08
0
how to overlay 2d pdf atop scatter plot using ggplot2
Hi, I am no expert on ggplot2 and I do not know the answer to your question. I looked around a bit but could not find an answer right away. But one possibility could be, if a direct approach is not possible, to draw ellipses corresponding to the confidence regions of the multivariate t density and use geom_polygon to draw this successively? I will wait for a couple of days to see if there is a
2010 Mar 09
1
ggplot2 rose diagram
Dear R gurus - consider this plot: library(ggplot2) dat <- sample(1:8,100,replace=TRUE) smp <- ggplot(data.frame(dat), aes(x=factor(dat),fill=factor(dat))) + geom_bar(width=1) smp + coord_polar() Q1. How do I change the font size and weight of bar labels (1,2,3...)? I've been wallowing in the 'Themes' structure and I just can't figure out the correct place to change
2009 Aug 28
1
problem plotting with ggplot2
Dear R-Help subsribers, upon running into a wonderful ggplot2 package by accident, I abruptly encountered another problem. Almost every command run with ggplot2 results in some sort of error. The one below is far the most common one. Kind people from ggplot2 mailing list couldn't manage to solve the problem, so I'm re-posting it here to try my luck. I will recommend myself for any tips
2007 Nov 13
1
ggplot2: changing axis labels in ggplot()
Hi all, For various reasons, I need to use ggplot instead of qplot for a complex figure. Everything is working fine, except I cannot figure out how to rename the axis labels in ggplot. I have pasted a simple example below. Any ideas on what I am doing wrong? Thanks for your help. James library(ggplot2) ##create data
2012 Jul 26
2
scale_y_logit not present in ggplot2 0.9?
I have updated from ggplot2 0.8.9 on Windows to ggplot 0.9.0 (and then 0.9.1) and I can't find scale_y_logit() anymore ... On Mac, I can't see scale_y_logit() in ggplot 0.9.0 either. Am I missing anything? Thanks
2007 Sep 03
1
Legend issue with ggplot2
Dear useRs, I'm struggling with the new version of ggplot2. In the previous version I did something like this. But now this yield an error (object "fill" not found). library(ggplot2) dummy <- data.frame(x = rep(1:10, 4), group = gl(4, 10)) dummy$y <- dummy$x * rnorm(4)[dummy$group] + 5 * rnorm(4)[dummy$group] dummy$min <- dummy$y - 5 dummy$max <- dummy$y + 5 ggplot(data
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
2008 Aug 11
2
ggplot2 font size problem
How do I change the font size of the label in ggplot. For example x=c("abcdefghijklmn", "opqrstuvwxyz") y=c(1, 2) df=data.frame(name=x, value=y) p=ggplot(df, aes(name, y))+geom_point() Now the name of "abcdefghijklmn" and "opqrstuvwxyz" are too long. How can I change the font size of them. And can I also change the orientation of them? thanks -- View
2007 Sep 27
3
Plotting from different data sources on the same plot (with ggplot2)
Hello everyone (and Hadley in particular), I often need to plot data from multiple datasets on the same graph. A common example is when mapping some values: I want to plot the underlying map and then add the points. I currently do it with base graphics, by recording the maximum region in which my map+point will fit, plotting both with these xlim and ylim parameters, adding par (new=T)
2012 Dec 21
2
ggplot2: setting martin
Is it possible to set the margin in ggplot2 to a fixed size? I create many plots, and I want them to look the same. Especially I want them to have the same left margin. But P<-ggplot()+geom_bar(aes(c("short label1","short label2"),runif(2)))+coord_flip() P<-creates a plot with another margin as ggplot()+geom_bar(aes(c("very very very very long
2010 Feb 08
3
ggplot2 stacked line plot
Hi all, I have been hunting around for hours trying to figure out how to generate a stacked line chart using ggplot2. This type of chart can be generated in excel 2007 by selecting: Chart type > Line > Stacked line. I can generate a stacked area chart using the following code: p <- ggplot2(~, aes(x = ~, y = ~, colour = Type)) + geom_area(aes(position = 'stack', fill = Type))