similar to: ggplot2: bug in geom_ribbon + log scale!?

Displaying 20 results from an estimated 1000 matches similar to: "ggplot2: bug in geom_ribbon + log scale!?"

2011 Jul 10
3
OpenOffice ods spreadsheets in R?
I would like to open OpenOffice (LibreOffice) .ods files in R. I've tried the ROpenOffice package from omegahat, but unfortunately, the read.ods() function attempts to use the values of the first column in a worksheet as row names, and thus does not allow duplicates in there (which, even more unfortunately, occur in my files). Also, the function does not allow to forward any other
2008 Feb 15
1
ggplot2 used in a function - variable scope/environment
Hi everybody! I'm trying to use ggplot2 to return a plot from a function (so I can add something or alter it then). Unfortunately, if I add a mapping to a layer in the function, the variable *name* is stored in the layer, rather than the variable's *value* - so that after the function returns the ggplot2-object, it doesn't plot because the variable don't exist in the
2010 May 30
2
geom_ribbon removes missing values
Hi everyone, it looks like geom_ribbon removes missing values and plots a single ribbon over the whole interval of x values. However, I'd rather want it to act like geom_line, that is, interrupt the ribbon for the interval of missing values and continue once there are new values. Here's an example: library(ggplot2) df <- data.frame( date = seq(from = as.Date("2010-05-15"),
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
2010 Sep 16
1
plotting time series using ggplots
Hi, I would like to plot a bunch of tree ring width data (time series) using ggplots, but I'm having trouble figuring out how to do it. My data is in a data.frame, with years as rownames and a distinct tree ring series in each column. So, something like this: rwl<-matrix(rnorm(800), nrow = 100) colnames(rwl) <- paste('V', 1:8, sep = '')
2007 Nov 23
1
ggplo2: fixed extent greater than data?
Hi everyone! I'm digging into ggplot for some while now, I must say it's great! But - as some others have posted before, and hadley knows very well himself - the documentation is lacking some bits... So I have to pose that question directly: I'd like to produce a series of maps with different data on, but exactly the same extent in each plot. Is there a way of switching the
2007 Jul 25
1
Ggplot2 equivalent of axis and problem with log scale
Dear useRs, Recently I've discorved ggplot2 and I must say that I really like it, although the documentation still is a working in progress. My first question: How can I change the position of the labels and the text of the labels? With a basic plot I would use axis(2, at = position.of.the.ticks, labels = text.at.the.ticks). Could someone provide me with an example of how to do this with
2023 Aug 12
2
geom_smooth
Colleagues, Here is my reproducible code for a graph using geom_smooth set.seed(55) scatter_data <- tibble(x_var = runif(100, min = 0, max = 25) ?????????????????????? ,y_var = log2(x_var) + rnorm(100)) library(ggplot2) library(cowplot) ggplot(scatter_data,aes(x=x_var,y=y_var))+ ? geom_point()+ ? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
2023 Aug 12
1
geom_smooth
?s 05:17 de 12/08/2023, Thomas Subia via R-help escreveu: > Colleagues, > > Here is my reproducible code for a graph using geom_smooth > set.seed(55) > scatter_data <- tibble(x_var = runif(100, min = 0, max = 25) > ?????????????????????? ,y_var = log2(x_var) + rnorm(100)) > > library(ggplot2) > library(cowplot) > > ggplot(scatter_data,aes(x=x_var,y=y_var))+
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi Put fill outside aes p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2], ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1) The "hole" is because you have two levels of data (red and blue). To get rid of this you should put new data in ribbon call. Something like newdat <- trainset newdat$z <- factor(0) p+geom_ribbon(data=newdat, aes(ymin =
2009 Apr 23
1
ggplot2/aesthetic plotting advice
Consider the following situation: we have quantified algal concentrations for a variety of species using many samples at each of three years. It seems to make sense to generate a line plot (matplot-like), with each species plotted as a separate line, with the points connected to emphasize the temporal pattern. The problem: lots of overlapping error bars. The question: from both a
2020 Oct 23
2
How to shade area between lines in ggplot2
Thank you, but this split the area into two and distorts the shape of the plot. (compared to ``` p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2], linetype = "dashed", col = "royalblue") + geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2], linetype = "dashed", col = "royalblue") ``` Why there
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi What about something like p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2], ymax = slope_1*x + intercept_1 + 1/w[2], fill = "grey70", alpha=0.1)) Cheers Petr > -----Original Message----- > From: Luigi Marongiu <marongiu.luigi at gmail.com> > Sent: Friday, October 23, 2020 11:11 AM > To: PIKAL Petr <petr.pikal at precheza.cz> > Cc: r-help
2020 Oct 23
2
How to shade area between lines in ggplot2
also from this site: https://plotly.com/ggplot2/geom_ribbon/ I get the answer is geom_ribbon but I am still missing something ``` #! plot p = ggplot(data = trainset, aes(x=x, y=y, color=z)) + geom_point() + scale_color_manual(values = c("red", "blue")) # show support vectors df_sv = trainset[svm_model$index, ] p = p + geom_point(data = df_sv, aes(x=x, y=y),
2023 Aug 12
1
geom_smooth
G'day Thomas, On Sat, 12 Aug 2023 04:17:42 +0000 (UTC) Thomas Subia via R-help <r-help at r-project.org> wrote: > Here is my reproducible code for a graph using geom_smooth The call "library(tidyverse)" was missing. :) > I'd like to add a black boundary around the shaded area. I suspect > this can be done with geom_ribbon but I cannot figure this out. Some >
2017 Nov 29
3
Removing a data subset
Say I have a dataset that looks like Location Year GW_Elv MW01 1999 546.63 MW02 1999 474.21 MW03 1999 471.94 MW04 1999 466.80 MW01 2000 545.90 MW02 2000 546.10 The whole dataset is at http://doylesdartden.com/ExampleData.csv and I use the code below to do the graph but I want to do it without MW01. How can I
2017 Nov 29
0
Removing a data subset
Reading in the data from the file x <- read.csv( "ExampleData.csv", header = TRUE, stringsAsFactors = FALSE ) Subsetting as you want x <- x[ x$Location != "MW01", ] This selects all rows where the value in column 'Location' is not equal to "MW01". The comma after that ensures that all columns are copied into the amended data.frame. Rgds,
2017 Sep 26
2
Adding non-data line to legend ggplot2 Maximum Contaminant Level
Hello everyone, I have a plot showing chloride concentrations for various point over time. I also have a dotted line that show the Secondary Maximum Contaminant Level (my screening limit) on the graphs at 250 mg/L. But I can not figure out how to include the dotted line / Secondary Maximum Contaminant Level in the legend. Any thoughts? My code is as following and is linked to my data on the
2013 Apr 18
1
Arranging two different types of ggplot2 plots with axes lined up
Hi all, I want to arrange two ggplot2 plots on the same page with their x-axes lined up - even though one is a boxplot and the other is a line plot. Is there a simple way to do this? I know I could do this using facetting if they were both the same type of plot (for example, if they were both boxplots), but I haven't been able to figure it out for two different types of plots. Below is my
2017 Oct 05
0
Adding non-data line to legend ggplot2 Maximum Contaminant Level
Well, here is one way but it seems a bit clumsy. In words, I created a new data.frame with "250" in the Chloride vector and "SMCL" in the Detections vector and supplessed one legend. Warning: For my convenience I am using different data.frame names . library(ggplot2) MyData <-read.csv("http://doylesdartden.com/Stats/TimeSeriesExample.csv", sep=",")