i want to plot some data with discrete x-axis and continuous y-axis.
For each break on the x-axis, 4 different y values exists.
With position="identity" the points or pointranges overlap each other,
so i tried "dodge" and "jitter".
I don't see any changes with "dodge" and with "jitter" for some points
it's a bit difficult to identify the belonging x-axis breaks.
Any ideas how to move the ponts a little bit to the left and the right
(the best would be a fixed amount for each variable level, see example
below).
I can't use facets, because I use it allready, the example below is just
the data for one facet.
example:
library(ggplot2)
d = structure(list(Bundesland = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Eisenstadt (BGL)",
"Graz (STM)", "Klagenfurt (KTN)", "Kremsmünster (OOE)", "Salzburg (SBG)",
"St. Pölten (NOE)"), class = "factor"), variable = c("CLM_A1B",
"CLM_B1", "CLM_A1B", "CLM_B1", "CLM_A1B", "CLM_B1", "CLM_A1B",
"CLM_B1", "Remo_A1B", "Remo_B1", "Remo_A1B", "Remo_B1", "Remo_A1B",
"Remo_B1", "Remo_A1B", "Remo_B1"), Dekade = structure(c(1L, 1L,
2L, 2L, 3L, 3L, 4L, 4L, 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L), .Label = c("1961-2000",
"2001-2030", "2031-2070", "2071-2100"), class = "factor"), SRES = structure(c(1L,
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("A1B",
"B1"), class = "factor"), mean = c(11.3087444999722, 11.3087444999722,
11.7518043639496, 11.8533944409593, 12.3789610591686, 12.229776183631,
13.1621765239205, 12.7607377942529, 13.0388901869159, 13.0388901869159,
13.610393167902, 13.5922494360296, 14.4502453271028, 14.1906542056075,
15.6681931464174, 15.178800623053), sd = c(0.558445359072224,
0.558445359072224, 0.643855367030372, 0.580734781470385, 0.736930693104638,
0.649717330030318, 0.666825505243008, 0.689166881171515, 0.649813010593805,
0.649813010593805, 0.598086022592438, 0.530013751143853, 0.802553323052953,
0.474180312808992, 0.682137990645673, 0.705061505200587)), .Names = c("Bundesland",
"variable", "Dekade", "SRES", "mean", "sd"
), row.names = c(NA, 16L), class = "data.frame")
ggplot(d) + geom_pointrange(aes(x=Dekade,y=mean,colour=variable,
ymin=mean-sd,ymax=mean+sd),position="jitter")
thanks for your help.
stefan
This is just an idea from a very novice R and ggplot2 user - I
apologize if I misunderstood your question.