Displaying 20 results from an estimated 25 matches for "free_y".
Did you mean:
free_s
2010 May 18
2
Function that is giving me a headache- any help appreciated (automatic read )
...ply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip <- precip.1
DF.precip$precipitation <- b$.data
#discharge
if(input=="data"){
return(DF)
}else{
qplot(Date, discharge, data=DF,
geom="line", ylab="Date")+facet_wrap(~gauge_name,
scales="free_y")+coord_trans(y="log10")}
if(input=="precipitation"){
#precipitation
qplot(Date, precipitation, data=DF.precip,
geom="line")+facet_wrap(~gauge_name, scales="free_y")
}else{
qplot(Date, discharge, data=DF,
geom="line", ylab="Date")+...
2011 Dec 23
1
simple ggplot2 question
...o parts, using facet_grid. I would like the vertical axis (labelled 'place') to be different for each location (=part). So in the upper part, only places 'n' through 'z' are shown, while in the lower part, only places 'a' through 'm' are shown. I thought 'free_y' would do the trick. I also tried converting variable place into class 'factor'.
require(ggplot2)
DF <- data.frame(place=letters, value=runif(26), location=c(rep(1, 13), rep(0, 13)))
qplot(data=DF, x=place, y=value, geom="bar", stat="identity") +
coord_flip()...
2009 Oct 06
1
ggplot2 applying a function based on facet
...h[,"time"])
date_time <- as.chron(paste(dts, tms), "%Y-%m-%d %H:%M")
DF <- data.frame(date_time, both)
library(ggplot2)
#discharge
if(input=="discharge"){
qplot(as.POSIXct(date_time), discharge, data=DF,
geom="line")+facet_wrap(~gauge_name,
scales="free_y")+coord_trans(y="log10")
}else{
#precipitation
qplot(as.POSIXct(date_time),
precipitation, data=subset(DF, precipitation!="NA"),
geom="line")+facet_wrap(~gauge_name, scales="free_y")
}
}
USGS("precip")
I would like to have the cumsum based o...
2020 Nov 24
2
Cambiar nombre de topic en análisis LDA
...= list(seed = 1234))
lda22 %>%
tidy() %>%
group_by(topic) %>%
top_n(10, beta) %>%
ungroup() %>%
mutate(term = reorder_within(term, beta, topic)) %>%
ggplot(aes(term, beta, fill = factor(topic))) +
geom_col(show.legend = FALSE) +
facet_wrap(~ topic, scales = "free_y") +
coord_flip() +
scale_x_reordered()
Muchas gracias
2010 Sep 11
1
Setting scales for ggplot2 with facets
...ut I fail
to see how one could control ylim and xlim ranges for each facet
separately.
For instance, I would like to set the ylim = c(0,10) for facet "A"
and ylim = c(42,102) for facet "B". Since the data is out of these
ranges,
setting facet_grid(factor ~ ., scales = "free_y") does not achieve the
goal .
Is there a decent way to achieve this or not? or I have to drop data
points
outside y-ranges as a quick hack?
Swen Laur
2010 Aug 24
1
drop unused levels in lattice dotplot axis?
...spaces along the y-axis in each panel. drop.unused.levels=TRUE will drop conditioning variables, but does not affect the levels in the y-variable.
I can get something like what I want with ggplot2:library(ggplot2)ggplot(data=dfr,mapping=aes(x=B,y=A)) + geom_point() + facet_wrap( ~ C,scales="free_y")
I wonder if this is possible in lattice?
Thanks!
Stephen
[[alternative HTML version deleted]]
2009 Jul 24
1
ggplot question
In page http://had.co.nz/ggplot2/scale_date.html , there is a time series
plot for multiple variables at the bottom. i.e
qplot(date, value, data = em, geom = "line", group = variable) +
+ facet_grid(variable ~ ., scale = "free_y")
How can I make different color for different series?
Thanks
--
View this message in context: http://www.nabble.com/ggplot-question-tp24641347p24641347.html
Sent from the R help mailing list archive at Nabble.com.
2009 Jan 22
1
ggplot2 example
...= unemploy,position = "lower"))
lower
#upper$date <- as.Date(upper$date,"%m/%d/%Y")
#lower$date <- as.Date(lower$date,"%m/%d/%Y")
ggplot(mapping = aes(x=date, y=value)) + geom_line(data = upper) + geom_area(data = lower) +
facet_wrap(~ position, scale = "free_y",ncol=1)
Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
...;, c('psavert','uempmed','unemploy'))
mcsm <- melt(data.frame(date=economics$date, q=quarters(economics$date)),
id='date')
mcsm$value <- factor(mcsm$value)
ggplot(subm, aes(date, value, col=variable, group=1)) + geom_line() +
facet_grid(variable~., scale='free_y') + geom_step(data=mcsm, aes(date,
value)) + scale_y_discrete(breaks=levels(mcsm$value))
If I leave out scale_y_discrete, R complains that I'm trying to combine
discrete value with continuous scale. If I include scale_y_discreate my
continuous series miss their scale.
Is there any neat wa...
2010 May 09
1
Is it possible to rearrange the facets in ggplot while keeping everything else the same?
...goes on like this for another 11 subjects.
I can plot a 3 row (A,B,C) x 4 column (Sub 1,2,3,4) grid of time courses with the y labels for the facets being 1,2,3,4 and the x labels for the facets being A,B,C.
qplot(Day,Value,data="data above") + facet_grid(Variable~Subject, scales="free_y")
But, how do I rearrange the columns so that all the Yeses to Ab are together and the Nos to Ab are together while keeping the same labeling?
Thanks in advance.
George Chen
2011 Jun 30
1
Italicized greek symbols in PDF plots
...uot;,"italic(\u03b4)^13*C"))
#So this is what I want my plot to look like:
plt <- ggplot(data = dat, aes(x = yy, y = x)) +
geom_point(aes(x= yy, y=x, shape=z, group=z), alpha=0.4,position =
position_dodge(width = 0.8)) +
facet_grid(gltr~.,labeller= label_parseall, scales="free_y")
plt
#So then I exported my plot as a PDF like so:
pdf("Times_regular.pdf", family='Times')
plt
dev.off()
#The problem with this was that the delta symbols turned into dots.
#I solved this problem using Cairo
library(Cairo)
cairo_pdf("Cairo.pdf")
plt
dev.off()...
2017 Jun 09
2
Color en líneas (ggplot2)
2017-06-08 12:54 GMT-04:00 Javier Marcuzzi <javier.ruben.marcuzzi en gmail.com>
:
> ¿me hice entender?
?No.
Para salir del escollo lo convertiré a gráficos? base y continuaré con mi
vida ?...
?Au revoir.?
--
«Pídeles sus títulos a los que te persiguen, pregúntales
cuándo nacieron, diles que te demuestren su existencia.»
Rafael Cadenas
[[alternative HTML version deleted]]
2009 Oct 06
2
ggplot cumsum refined question (?)
...eight", "discharge",
"precipitation", "gauge_name"), row.names = c(NA, -266L), class = "data.frame")
qplot(as.POSIXct(date_time), precipitation, data=subset(DF,
precipitation!="NA"), geom="line")+facet_wrap(~gauge_name,
scales="free_y")
#if I issue:
qplot(as.POSIXct(date_time),
cumsum(precipitation), data=subset(DF, precipitation!="NA"),
geom="line")+facet_wrap(~gauge_name, scales="free_y")
#ggplot will plot the total cumulative sum and not the sum based no
the facet(factor) I am trying to p...
2009 Jan 14
1
publication statistics from Web of Science
...ts.melt <- melt(stats.df, id.var=c("date", "search"))
str(stats.melt)
# stats.melt <- within(stats.melt, counts=value)
library(ggplot2)
p <- ggplot(data = subset(stats.melt, date>1960 ), mapping = aes(x =
date,y = value)) +
facet_wrap(~search,ncol=2, scale="free_y") +
layer(colour="grey", geom = c( "histogram"), stat = "identity" ) +
scale_y_continuous("number of publications")
p
_____________________________
Baptiste Augui?
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phon...
2010 Feb 04
2
ggplot2 / time series with different scales
I am trying to plot this dataset using ggplot2:
df <- data.frame(
sid = c(rep('11',30),rep('22',30)),
time = rep(ISOdate(year = 2010, month = 1, day = 1:30),2),
sales = c(rnorm(30, 1000, 20),rnorm(30, 900, 10)),
price = c(rnorm(30, 2, 0.5),rnorm(30, 3,0.5))
)
Plotting just the sales can be done easily:
ggplot(data=df, aes(x=time, y=sales, group=sid, color=sid)) +
2011 Jan 10
1
Basic ggplot question
Hello R-Group,
I am trying plotting simple time-series with ggplot2 because the output
looks better and I've heard its richer in features.
I have the following dataset.
> dput(dat)
structure(list(Date = structure(c(14970, 14971, 14972, 14973,
14974, 14977, 14978, 14979, 14980, 14981), class = "Date"), Close =
c(5998.1,
5996, 6060.35, 6101.85, 6134.5, 6157.6, 6146.35, 6079.8,
2008 Nov 17
1
ggplot2: can one have separate ylim for each facet?
In lattice
#toy data
library(ggplot2)
library(lattice)
x <- rnorm(100)
y <- rnorm(100)
k <- sample(c("Weak","Strong"),100,replace=T)
j <- sample(c("Tall","Short"),100,replace=T)
w <- data.frame(x,y,j,k)
xyplot(y~x|j+k,scales=list(y=list(relation="free")))
will give you a scale in each subplot with a range equal to the range
of y
2012 Oct 22
0
Lattice to ggplot2: Reference graphics across facets
...ng ribbon
p <- p + stat_summary(aes(group = 1), subset(ecg, trt == 'Placebo'),
fun.ymin = 'q25', fun.ymax = 'q75', geom = 'ribbon', fill = 'gray80', colour
= NA)
# Basic plot
p <- p + geom_boxplot()
p <- p + facet_grid(variable ~ trt, scales = 'free_y')
# Median line - again, want to reflect across rows
p <- p + stat_summary(aes(group = 1), subset(ecg, trt == 'Placebo'), fun.y =
'median', geom = 'line', colour = 'gray60')
# Formatting
p <- p + labs(x = '', y = '')
p <- p + theme(leg...
2010 Jul 05
2
Plot with whispers
Hello!
I need to make a plot with whispers that does the following.
Reads in 50 files, each file containing 200 data points. A file looks like
this:
base100.log
Send Receive
10.5 100.3
15.0 102.4
...
There are 100 lines, each with two data points. I need to read in the 50
files, and plot three lines
The first line is the mean of the send column with whiskers indicating
standard deviation
2010 Oct 29
3
Dickey Fuller Test
Dear Users, please help with the following DF test:
=====
library(tseries)
library(timeSeries)
Y=c(3519,3803,4332,4251,4661,4811,4448,4451,4343,4067,4001,3934,3652,3768
,4082,4101,4628,4898,4476,4728,4458,4004,4095,4056,3641,3966,4417,4367
,4821,5190,4638,4904,4528,4383,4339,4327,3856,4072,4563,4561,4984,5316
,4843,5383,4889,4681,4466,4463,4217,4322,4779,4988,5383,5591,5322,5404