similar to: adding custom details to ggplot subplots

Displaying 20 results from an estimated 2000 matches similar to: "adding custom details to ggplot subplots"

2007 Jul 24
1
ggplot2 axis color
Hi: Does anyone have an idea on how to color the axis and labels using ggplot2? This is what I got: library(ggplot2) p <- qplot(total_bill, tip, data = tips) NewPlot<- p + geom_abline(slope=c(0.1,0.15,0.2), colour=c("red","blue","yellow"),size=c(2,5,2)) NewPlot + geom_smooth(colour="green", size=3,linetype=3)
2006 Oct 24
1
[ggplot] trouble with ggabline and log-log-plots
Hello, I'm trying to generate a log-log plot with ggplot. Within this plot, I would like to draw a straight line with the help of ggabline which does not work. The code is pl1 <- qplot(correlFunc, correlFunc.ref, data=all, log=c("xy")) pl1 <- ggabline(pl1, slope=1, intercept=0) print(pl1) ## no line in plot :( I can produce plots as I want, if I transform all values before
2006 Aug 02
4
ggplot facet label font size
How do I change the font size in the facet labels along the edges of the plot? For example (from the ggplot help file): p<-ggplot(tips, sex ~ smoker, aesthetics=list(x=tip/total_bill)) gghistogram(p) In this plot, the facet labels are "smoker: No", "smoker: Yes", "sex: Female", "sex: Male". What command can I use to reduce the font size of
2006 Oct 27
2
qplot of ggplot package how to plot different size according to the values and not to the weights?
I have the following Data structure $ step45 : Factor w/ 2 levels $ obserror : num 6.2 6.2 5.6 6.6 6.6 ... $ Mon : num 2.2 2.0 1.0 3.2 2.0 ... $ inc.comp : num 4 5 2 5 5 5 5 5 4 4 ... all I wanted to do is plotting Mon against obserror, the colors should be by step45 and the size of the symbol should be according to inc.comp so I did this:
2007 May 13
2
suppressing outliers in ggboxplot
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070513/473acf08/attachment.pl
2009 Apr 01
2
help with ggplot2 -- ggpoint function missing?
I'm trying to follow the ggplot introduction here: http://had.co.nz/ggplot/ggplot-introduction.pdf I've installed ggplot2 with install.packages("ggplot2", dep=T) but when I try to run print(ggpoint(p, list(colour = sex))) I get an error: Error in print(ggpoint(p, list(colour = sex))) : could not find function "ggpoint" What is the problem? Has the function been
2020 Oct 23
5
How to shade area between lines in ggplot2
Hello, I am running SVM and showing the results with ggplot2. The results include the decision boundaries, which are two dashed lines parallel to a solid line. I would like to remove the dashed lines and use a shaded area instead. How can I do that? Here is the code I wrote.. ``` library(e1071) library(ggplot2) set.seed(100) x1 = rnorm(100, mean = 0.2, sd = 0.1) y1 = rnorm(100, mean = 0.7, sd =
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi Did you try google? I got several answers using your question e.g. https://stackoverflow.com/questions/54687321/fill-area-between-lines-using-g gplot-in-r Cheers Petr > -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of Luigi Marongiu > Sent: Friday, October 23, 2020 9:59 AM > To: r-help <r-help at r-project.org> > Subject:
2012 Jul 19
2
problem with using apply for dataframe
Dear people, I am including an example of a dataframe: mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female")) When I use the sapply function getting the information about the factors works: sapply(mydataframe,function(x)is.factor(x)) X total_bill tip
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),
2011 Jun 26
1
changing graphs in qqplot2
This is what I have now so far. p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) + geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY) > p +scale_x_continuous(limits=c(1,4)) http://r.789695.n4.nabble.com/file/n3626510/graph.gif I would also like to: 1.) change the headline for the faced wraps ?high? and ?low?. Is there any other way of
2006 Mar 07
3
Making an S3 object act like a data.frame
"[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[", x) } "[[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[[", x) } "$.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("$", x) } > class(x) [1]
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 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 =
2007 Nov 08
1
ggplot2 geom_abline slope not working?
I am learning ggplot2, and need your help. When I try > p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() > p + geom_abline(slope=5) (from http://had.co.nz/ggplot2/geom_abline.html) the slope of the abline does not change, but this works: > p + geom_abline(intercept=20) In order to have slope work, I have to use > p + geom_abline(aes(slope=5)) Is it a bug, or is there
2012 Mar 15
2
Ggplot barchart drops factor levels: how to show them with zero counts?
Hello, When plotting a barchart with ggplot it drops the levels of the factor for which no counts are available. For example: library(ggplot) mtcars$cyl<-factor(mtcars$cyl) ggplot(mtcars[!mtcars$cyl==4,], aes(cyl))+geom_bar() levels(mtcars[!mtcars$cyl==4,]) This shows my problem. Because no counts are available for factorlevel '4', the label 4 dissapears from the plot. However, I
2011 Nov 08
2
nesting scale_manual caracteristics in ggplot
Hi there, I am having a little problem with combining three scale_manual commands in a facet plot. I am not able to combine the three different characteristics, instead ending up with three different descriptions next to the graph for the same geom. I would like to see two separate labels (not three); one describing lines 1-7 and the other 8-14. For each of the treatments (A-B) I want a
2011 Nov 06
1
Request for Help: y-axis label overlapped by x-axis in subplots in big plot
Dear All, I would like to seek for help on this issue: 1. I set par(mfrow=c(2,2)), hoping to plot 4 subgraphs in a whole graph 2. Each subgraph has its own x,y axes and each has x-axis label and y-axis label 3. moreover, subgraphs in the left column of the whole graph are all 3D, and have z axes and labels for z axes 4. subgraphs in the right column of the whole graph are all 2D 5. In each
2003 Sep 14
1
title for plot contain 4 subplots
Hi, I'm plotting 4 graphs on one page (2x2 matrix) but I cant seem to get the title for the whole page right. I'm doing: op <- par(mfrow = c(2,2), pty="s") hist(var$V2, breaks="FD",main="Euclidean Metric", xlab="Sum of 3NN ... hist(var$V2, breaks="FD",main="Manhattan Metric", xlab="Sum of 3NN ... hist(var$V2,