Displaying 20 results from an estimated 2000 matches similar to: "ggplot2 customizing a plot"
2013 Feb 25
1
ggplot2 Increase font size
Dear all,
I am using the code as below
tdm <- melt(matrixToPlot)
p<- ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +
labs(x = "Mz", y = "T", fill = "D") +
geom_raster(alpha=1) +
scale_fill_discrete(h.start=1) +
scale_x_continuous(expand = c(0, 0)) +
2013 Mar 25
2
Plot Matrix with Data
Hi ,
I would like to use ggplot2 to plot a matrix as an image.
You can copy paste the following
Data<-matrix(data=rnorm(900,80,20),nrow=30,ncol=30)
lengthOut<-5
Lengths<- 15
library(reshape2)
library(ggplot2)
tdm <- melt(Data)
ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value)),levels=seq(0,1,by=0.1)) +
labs(x = "MHz", y =
2013 Feb 14
2
Plot a Matrix as an Image with ggplot
Dear all,
I am trying to plot a matrix I have? as an image
str(matrixToPlot)
?num [1:21, 1:66] 0 0 0 0 0 0 0 0 0 0 .
?that contains only 0s and 1s,
where the xlabel will be Labeled as
str(xLabel)
?num [1:66] 1e+09 1e+09 1e+09 1e+09 1e+09 ...
and the yLabels will be labeled as
str(yLabel)
?num [1:21] -88 -87 -86 -85 -84 -83 -82 -81 -80 -79 ...
I have found on the internet that I can do
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
R-users it appears I am leaning on your knowledge once again. Is there any way to add a vertical line to a histogram and qplot "stacked" plot? Here is my current attempt:
"qplot" approach attempt:
qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq")
2012 Nov 29
1
Coerce rownames to factor for ordering
Hi all,
I think this might be an easy one but I cannot think of a way to do this
other than what I am currently attempting. I simply want to sort my data
frame's rownames by a defined vector so that the plots I generate from that
vector are in the desired order
Consider the test data below:
#Create test data
DataToPlot.. <- data.frame("Location1" =
2006 Oct 27
2
Question: xyplot panel configurations for Trellis package
Hi,
I am new to R community and I have a question on panel configurations in
the Trellis package.
Particularly, I have the following code:
require(lattice)
plotTable <- NULL
Date <- seq(as.Date("2006-11-01"), as.Date("2009-12-01"), by = 1)
nYear <- length(unique(format(Date,"%Y")))
plotTable$Date <- as.Date(paste(unique(format(Date, "%Y-%m")),
2009 Jan 28
1
Changing histogram stack in qplot
I've been using qplot pretty successfully to generate stacked histograms. However, it appears that I need to tweak the colors a little.
I've got three temperature variables (characters not numeric) and I need to change from the default qplot colors to the following:
Low = Blue
Middle = black
High = Red
Here is pseudo code of what I have currently:qplot(Run, data = TestData, breaks =
2013 Sep 18
1
ggplot2: changing strip text in facet_grid and a legend text problem
Hi,
Dummy data script and scripts are attached below.
I would like to change the plot to look like this:
2009 Jan 30
1
Using ggplot2 I need to move the location of legend to on the plot
Thanks again for the hints about adding the vertical line to the hist plot and in ggplot. That worked great.
Based on that advice I've been flipping through the ggplot2 doc and ggplot-static\index.html webpage more looking for the answer to the next question.
Unfortunately, I haven't stumbled on a description of how to move around the location of the legend.
Here is what I
2009 Mar 20
1
how can I find actual axis limits for an existing plot?
I would like to query an existing plot to learn the actual x and y
limits of the plottable area. Is this possible? I can discover the
extreme tick mark locations but not the actual plot area limits.
Setting the limits with ylim will not help in this case because I am
overplotting an existing plot with a separate function, and I don't want
my end-user to have to pass parameters around.
2015 Jun 16
4
Ayuda boxplot ggplot2
Hola a todos
Me gustaría saber si me pueden ayudar con lo siguiente.
Realicé un Boxplot usando ggplot2 para visualizar el comportamiento de dos
variables. Visualmente no se notan las diferencias porque la gráfica de la
derecha (parásitos en el abdomen) llega hasta 20 en el eje y. ¿Cómo puedo
hacer para que las dos gráficas muestren la misma escala en el eje Y, es
decir, que las dos lleguen a 60?
2009 Jul 28
2
Density plot in ggplot2
Hi all, I was trying to draw a stacked density plot like that :
library(ggplot2); library(plyr)
dat <- cbind(rnorm(300), rep(c(1,2), each=150))
ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]),
position="stack")) +
xlab("") + ylab("") +
scale_colour_manual(name = "Pallet", labels = c("X", "Y"))
Here
2023 Feb 21
2
Problem of intercept?
Dear R-experts,
Here below my R code working with quite a few warnings.?
x11 and x12 are dichotomous variable (0=no and 1=yes). I substract 1 to ignore intercept.
I would like not to ignore intercept. How to modify my R code because if I just remove -1 it does not work?
y= c(32,45,65,34,23,43,65,76,87,98,7,867,56,45,65,76,88,34,55,66)
x11=c(0,1,1,0,0,1,1,1,0,0,1,0,0,1,0,0,1,1,0,1)
2009 Oct 14
1
change order of bar plot categories
Is this what you want?
temp<-c(rep("Low",2),rep("Medium",2),rep("High",2))
light<-rep(c("Dark","light"),3)
avg<-dat.avg2[,3] #
se<-dat.avg2[,4]
dat.avg.temp<-data.frame(cbind(avg,se))
dat.avg.temp<-data.frame(cbind(temp,light,dat.avg.temp))
dat.plot<-qplot(light,avg, fill=factor(temp),data=dat.avg.temp,
geom="bar",
2017 Nov 21
0
How to produce rainfall maps
Hi,
You might get more help from the R-sig-geo list, which is devoted to
spatial topics.
However.
The *.asc file is an ArcGIS raster export format. You should use
whatever the appropriate import commands are for your own gridded
rainfall data. If you have a different format, you might or might not
be able to import it directly with raster.
?raster will tell you more about the kinds of formats
2017 Nov 17
2
How to produce rainfall maps
Dear R users,
I need to produce rainfall maps using R.
I know that this is possible, I looked though the web, I found the example below reported (the author is Andrew Tredennick).
I would ask you if this is the most performing way to make rainfall maps; if yes would someone be able to give me an example of how file.asc and pointfile.csv should be? If no would somebody please show me another way
2012 Apr 20
1
ggplot2: Legend title
I'm designing a set of plots intended for a general audience; here's the code for one of them, using the latest version of ggplot:
plot.enr.all <-
ggplot(data=df1, aes(x=HS_GRAD_YEAR, y=Percentage, group=Enrolled_by,
color=Enrolled_by, shape=Enrolled_by, fill=Enrolled_by)) +
geom_line() + geom_point(size=3.5) +
scale_y_continuous(breaks=seq(0, 100, 10),
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
Hi all,
This seems like a basic problem, but no amount of playing with the code has
solved it. I have a time-series data set like that shown below (only longer)
and am seeking to plot the data with filled, circular points and error bars.
I would like the error bars to be behind the points otherwise they tend to
obscure the points (especially when I have a lot of points in the actual
data set).
2012 Aug 04
2
ggplot2 boxplot help
Hello,
I have a data set that looks like this:
name G-ID test_id g-id g
1 00077464 C_068131 C_068131 OC_068131 -
2 00051728 C_044461 C_044461 OC_044461 -
3 00058738 C_050343 C_050343 OC_050343 -
4 00059239 C_050649 C_050649 OC_050649 -
5 00001761 C_000909 C_000909 OC_000909 -
6 00005119 C_002752 C_002752 OC_002752 -
locs
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form
for input (with no structural normalization), so conversion to points is
perfectly proper here, albeit confusing in context. (It's closer to what
graphics devices actually use ultimately, but the expansion is laid out
very early in ggplot2 because there's no standard for intermediate forms.)
Cheers, Mike
On Wed,