Skip to content

Commit fded552

Browse files
committed
Add scale_linetype_discrete
1 parent 6f8e2bf commit fded552

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ggplot2 0.8.5 (2009-XX-XX) ----------------------------------------
2929
instead of the previous behaviour where scales where added as layers were
3030
added - this could cause problems if you layer modified the plot.
3131
(Implements #28)
32-
* scale_shape_discrete and scale_size_continuous added to scales to match
33-
naming convention of all other scales (Fixes #47)
32+
* scale_shape_discrete, scale_size_continuous and scale_linetype_discrete
33+
added to scales to match naming convention of all other scales (Fixes #47)
3434
* scale_colour_gradient, scale_colour_gradient2 & scale_colour_gradientn now
3535
have formatter argument to match scale_continuous
3636
* legends will only merge if both the title and all labels are the same.

R/scale-linetype.r

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
ScaleLinetype <- proto(ScaleDiscrete, expr={
1+
ScaleLinetypeDiscrete <- proto(ScaleDiscrete, expr={
22
doc <- TRUE
33
common <- NULL
44
.input <- .output <- "linetype"
5+
alias <- "scale_linetype"
56

67
output_set <- function(.) c("solid", "22", "42", "44", "13", "1343", "73", "2262", "12223242", "F282", "F4448444", "224282F2", "F1")[seq_along(.$input_set())]
78
max_levels <- function(.) 12
@@ -10,7 +11,7 @@ ScaleLinetype <- proto(ScaleDiscrete, expr={
1011

1112
# Documentation -----------------------------------------------
1213

13-
objname <- "linetype"
14+
objname <- "linetype_discrete"
1415
desc <- "Scale for line patterns"
1516

1617
icon <- function(.) {
@@ -32,7 +33,7 @@ ScaleLinetype <- proto(ScaleDiscrete, expr={
3233
qplot(date, value, data=ecm, geom="line", linetype=variable)
3334
qplot(date, value, data=ecm, geom="line", colour=variable)
3435

35-
# See scale_manual for more flexibilit
36+
# See scale_manual for more flexibility
3637
}
3738

3839
})

R/xxx.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ scale_fill_hue <- ScaleHue$build_accessor(list(variable = "\"fill\""))
6565
scale_fill_identity <- ScaleIdentity$build_accessor(list(variable = "\"fill\""))
6666
scale_fill_manual <- ScaleManual$build_accessor(list(variable = "\"fill\""))
6767
scale_linetype <- ScaleLinetype$build_accessor()
68+
scale_linetype_discrete <- ScaleLinetypeDiscrete$build_accessor()
6869
scale_linetype_identity <- ScaleIdentity$build_accessor(list(variable = "\"linetype\""))
6970
scale_linetype_manual <- ScaleManual$build_accessor(list(variable = "\"linetype\""))
7071
scale_shape <- ScaleShape$build_accessor()

0 commit comments

Comments
 (0)