Displaying 20 results from an estimated 600 matches similar to: "Suppressing the labelling of tick marks on ggplot2"
2023 Nov 24
1
ggplot adjust two y-axis
Dear R-users
Is it possible to adjust two y-axis in a ggplot differently?
- First y axis (0-60)
- Second y axis (0-2500)
### Figure 1
ggplot(Fig1,aes(BFF,Wert,fill=Studien_Flaeche))+
geom_bar(stat="identity",position='dodge')+
scale_y_continuous(name="First Axis", sec.axis=sec_axis(trans=~.*50,
name="Second Axis"))+
2023 Nov 24
1
ggplot adjust two y-axis
Hi Sibylle,
For that kind of data with two different scales, I generally use two graphs
that I name gg1 and gg2 and join them using gridExtra::grid.arrange(gg1,
gg2). This way, the red part of your graph is easier to interpret.
Have a nice day,
Charles-?douard
-----Message d'origine-----
De?: R-help <r-help-bounces at r-project.org> De la part de
sibylle.stoeckli at gmx.ch
Envoy??:
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
2010 Sep 20
1
ggplot2 - bar colour
Hi All,
I have trying to do what I thought was a reasonably simple graph but I think
I'm now going in circles with the colour. Attached is a picture of where I'm
up to.
The line creating this is:
qplot(ageincgraph$age, ageincgraph$rate, position="dodge", stat="identity",
geom="bar" ) + aes( colour=ageincgraph$era) +
2023 Nov 24
1
ggplot adjust two y-axis
Hi,
I don't know the axis mecanism well enough in ggplot but using the original
barplot function you can add an axis on the right using the axis function.
Here is an example:
test <- as.table(matrix(c(2,10,3,11), 2,2))
barplot(test, beside = TRUE, col = scales::brewer_pal(palette = 1)(2))
axis(4, at = c(0, 5, 10), labels = c(0,50,100))
-----Message d'origine-----
De?:
2008 Dec 19
1
diagonal lines in legends of ggplot2
Hi, I have the following problem with ggplot2: When I specify black contours
for bars in a barplot, ggplot automatically shows diagonal lines in the
legend boxes. Is there a way, to remove these diagonal lines?
Here's a simple example:
library(ggplot2)
df<-data.frame(x=gl(6,1),y=rnorm(6,100,50))
ggplot(df,aes(y=y,x=x,fill=x))+geom_bar(aes(group=x),colour='black',size=1)+
2020 Sep 23
2
ORDEN GRÁFICO POR MESES
Hola,
Estoy haciendo un gráfico con:
#############################################################################
## GRAFICO BARRAS : VALORES AL DEBE MENSUALIZADO
ggplot(Diario_S2, aes(x=mes_AAA, by = MES , y=ARS_DEB))+ # ASIGNAR
VARIABLES
geom_bar(stat="identity", width=0.7, # ANCHO BARRAS
colour="grey", fill="darkgreen", #
2023 Nov 24
1
ggplot adjust two y-axis
Dear Charles-Edouard
Thanks a lot. Yes indeed barplot sounds excellent.
Unfortunately, the scale of the smaller axis is fixed, even If I am able to
draw to axes. The idea is to expand the scale to the scale to the second
axis for comparison.
F1 <- as.table(matrix(c(50,11,6,17,16,3,1,2237,611,403,240,280,0,0), 2,7))
barplot(F1, beside = TRUE, col = c("blue", "grey"))
2023 Nov 24
1
ggplot adjust two y-axis
Hi,
Just find a scaling factor that would make the two sets of data comparable.
Here I divided the second row by 5 and did the same for the second axis.
Charles-?douard
F1 <- as.table(matrix(c(50,11,6,17,16,3,1,2237,611,403,240,280,0,0), 2,7))
barplot(F1, beside = TRUE, col = c("blue", "grey")) axis(2,
at=c(0,10,20,30,40,50,60, labels=c(0,10,20,30,40,50,60))) axis(4, at =
2012 Jan 29
1
ColorBrewer question
Hello, R friends,
I'm trying to change colors of my horizontal bars so that they show a sequence.
I chose the ColorBrewer palette "Blues". However the resulting plot doesn't show any changes to the default.
I tried several places of "+ scale_colour_brewer(type="seq", pal = "Blues")" with no effect.
This is my code:
p <- ggplot(data, aes(x =
2016 Apr 09
1
Run script R
hi all ,?
i have an problem in script R . But when I execute the script R I face this error . can you help me please ???error:-----------------------------------------
Error in FUN(X[[i]], ...) :?? Theme element 'text' has NULL property: margin, debugIn addition: Warning messages:1: Removed 361 rows containing non-finite values (stat_smooth).?2: Removed 361 rows containing missing values
2009 Dec 04
2
[ggplot2] Wind rose orientation
Aloha all,
I love using ggplot. It took a while to get used to the grammar of
graphics, but it is starting to get easy now that I am thinking in a
more structured way.
A question. I'm making a wind rose that I'd like to be oriented with
due north straight up. I've discovered that the orientation is
sensitive to how north is represented. When north is represented as
0,
2012 Jun 06
5
ggplot incorrect legend
How do I create a legend with ggplot?
I think should be getting the FuelTypeNum in the legend.
Plot:
http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg
My code is:
ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) +
geom_bar(position="stack", stat="identity") +
scale_colour_hue('my legend', breaks = levels(tempTable$FuelTypeNum),
2008 Jun 16
2
in axis() suppressing axis line but keeping tick marks
I've been trying to figure out a parameter that will let you separately
adjust the parameters for the axis line from the tick mark.
In the following example, I would like to suppress the axis line, but keep
the tick marks.
Thanks,
Andrew
foo <- data.frame(x=1:3, y=4:6)
plot(foo$x, foo$y, type="n", axes=F)
points(foo$x, foo$y)
axis(side=1, at=foo$x, lty=0) #would like to figure
2013 Feb 04
1
Combining data from different saved files with same object names into one data frame
Hi,
I am simulating data from a zero-inflated negative binomial model. I have 4
different conditions and I've saved various information about the models in
zinbsumbstat-jklm.rdata (as shown below). What I want to do is print
information from each of these *.rdata and store them in one large object
(a matrix or a data frame). However, within each data the objects all have
the same name. So I
2012 Nov 02
9
Custom block script started twice for root block but only stopped once
Hi,
I''m using a custom block script in my xen setup and when started, it
creates a new device node pointing to some network resources.
Now I noticed that the script is called twice for the root block, the
first time for pygrub most likely, but is only stopped once ... I
don''t mind creating two devices node, but then I need to destroy both
...
Is this a known issue ?
Cheers,
2011 Jul 07
1
Confidence bands in ggplot2
Hi,
I have the following data:
> est
sch190 sch107 sch290 sch256 sch287 sch130 sch139
4.16656026 2.64306071 4.22579866 6.12024789 4.49624748 11.12799127 1.17353917
sch140 sch282 sch161 sch193 sch156 sch288 sch352
3.48197696 -0.29659410 -1.99194986 10.23489859 7.77342138 6.77624539 9.66795001
sch368
2011 Mar 08
3
allocating factor levels
Dear R users,
I am working on allocating the rows within a dataframe into some
factor levels.Consider the following dataframe:
Start.action Start.time
1 Start.setting 2010-12-30 17:58:00
2 Start.setting 2010-12-30 18:40:00
3 Start.setting 2010-12-31 22:39:00
4 Start.setting 2010-12-31 23:24:00
5
2009 Dec 11
4
extracting vectors from lists of lists
Good evening
I often have as output from simulations a list of various values, vectors
and matrices.
Supposing that I then run said simulation several times, I often want to
extract a particular result from each simulation for plotting and,
ideally, put it in a matrix.
A simple example
v1 <- 1:5
v2 <- 6:10
other1 <- "stuff"
other2 <- "stuff"
set1 <-
2013 Feb 01
2
Change default order of colors & line types
Dear R users,
I'd like to change the default order of colors & line types.
Especially I am using ggplot2 and using color Set1.
In Set1, the default color order is red, blue, green, violet,.. ect.
However, I want to put red in fourth (not first).
Likewise, I want to change the order of default linetype. I want to
put "solid" line in fourth.
How can I do thses?
R code to draw the