forked from tidyverse/ggplot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NEWS
2052 lines (1299 loc) · 73.2 KB
/
NEWS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ggplot2 1.0.1
----------------------------------------------------------------
* Fixes to pass `R CMD check --run-donttest` in R-devel.
ggplot2 1.0.0
----------------------------------------------------------------
NEW FEATURES
* New coordinate system for small scale maps. `coord_quickmap()` computes and
sets the correct aspect ratio between one degree of latitude and one degree
of longitude at the centre of the plotted region. It does not perform full
fledged mapping projection as `coord_map()` does and therefore is much
faster. Yet, it gives a correct approximation for small scale maps (a few
degrees in either direction) at medium to low latitudes (@jiho, #922).
* `geom_boxplot` gain new `varwidth` argument for controlling whether or not
the width of boxplots should be proportional to the size of the groups
(@tsieger, #927).
* `position_jitterdodge()` combines `position_jitter()` and `position_dodge()`,
allowing the user to plot and align points generated by e.g. `geom_point()`
with those generated by a dodged `geom_boxplot()`. See
`example(position_jitterdodge)` for a potential usage. (@kevinushey, #932)
* Allow specifying only one of the limits in a scale and use the automatic
calculation of the other limit by passing NA to to the limit function,
`xlim()` or `ylim()` (@jimhester, #557).
* Allow to use brewer palettes for continuous scales, through the new
`scale_fill/colour_distiller()` functions (@jiho, #925).
* `stat_ellipse()` adds data ellipses. It supports bivariate normal and t distributions,
as well as a euclidian distance circle. (@jofrhwld, #926)
* Add new themes: `theme_linedraw()` is similar to `theme_bw()` but with
truly only white and black elements and spacing between elements identical
to `theme_gray`. `theme_light` is similar but with light gray box and axes
around the plot, to emphasise content more (@jiho, #923)
* new theme settings panel.margin.x and panel.margin.y (units) allow
specifying horizontal and vertical gap between panels in facetted plots (for
both grid and wrap). (Kirill Müller. Fixes #839)
* Fix vertical justification for rotated text. This will change the appearance
of plots that use textual elements that are rotated by 90° or 270° and have a
`vjust` parameter other than the default 0.5; the interpretation of `vjust`
and `hjust` is now the same for both rotated and non-rotated text elements
(0 = top/left, 1 = bottom/right, 0.5 = centered). (@krlmlr, #883)
* Added helper function `labeller()` for formatting faceting values.
(@stefanedwards, #910). Added `label_wrap_gen` based on
https://github.com/hadley/ggplot2/wiki/labeller#writing-new-labellers
(@stefanedwards, #910)
BUG FIXES AND MINOR IMPROVEMENTS
* `aes()` no more treats variables like `a..x..b` as a calculated aesthetic.
(@krlmlr, #834.)
* New `aes_q()` function to generate aesthetic specifications from
quoted calls/names. `aes_string()` uses names `x` and `y` for first
two unnamed arguments.
* `fortify.SpatialPolygonsDataFrame()` now calls `polygons` without
requiring the `sp` to be loaded first (@seancarmody, #879).
* The outliers of `geom_boxplot()` use the default colour, size and shape from
`geom_point()`. Changing the defaults of `geom_point()` with
`update_geom_defaults()` will apply the same changes to the outliers of
`geom_boxplot()`. Changing the defaults for the outliers was previously not
possible. (@ThierryO, #757)
* `geom_dotplot()` now works with `qplot()`. (@rasmusab. Fixes #825)
* Marginal improvements to `theme_bw()` and `theme_classic()` (@jiho, #934)
* `stat_smooth()` checks for `method = "auto"` and `method = "glm"` in
a safer way.
* Add `"none"` to documentation of `theme()` for parameter `legend.position`
(@krlmlr, #829).
REMOVED FUNCTIONALITY
* `ggpcp()`, `ggfluctuation()`, `ggmissing()`, `ggstructure()`, and
`ggorder()` are now defunct and have been removed.
ggplot2 0.9.3.1
----------------------------------------------------------------
BUG FIXES
* The theme element `legend.box.just` now can be set. It was not properly
recognized before.
* `stat_density2d` previously resulted in errors when geom="polygon". This
is fixed. (Fixes #741 and #749)
* `annotation_logticks` previously drew one set of logticks for each group,
and inherited aesthetic mappings like colour. It no longer does this. (Fixes
#767)
* Plots with geom_crossbar not display correct symbol in legend. (Fixes #768)
* Grouping is no longer set automatically by `stat_summary()`, allowing for
summary paths. This reverts a change made for 0.9.3. (Fixes #732 and #739)
ggplot2 0.9.3
----------------------------------------------------------------
* The `plotmatrix` function has been deprecated and prints a warning
message.
* `stat_bin` now produces warning messages when it is used with set or
mapped y values. Previously, it was possible to use `stat_bin` and
also set/map y values; if there was one y value per group, it would
display the y values from the data, instead of the counts of cases for
each group. This usage is deprecated and will be removed in a future
version of ggplot2. (Winston Chang. Fixes #632)
* Several small changes were made so that ggplot2 is compatible with
plyr <= 1.7.1 as well as plyr > 1.7.1.
* `geom_polygon` draws multiple polygons as a single grob instead of as
separate grobs. This results in much better performance. For example,
drawing a world map is about 12 times faster. (Winston Chang. Fixes #666)
MINOR FEATURES
* A new theme `theme_minimal` has been added. This theme is based on
`theme_bw`, but does not have outlines around many of the rectangular
elements. (Baptiste Auguie)
* A new theme `theme_classic` has been added. This theme has is based on
`theme_bw`. It has x and y axis lines, but no box around the plotting area
and no grid lines. (Thanks to David Kahle)
* `geom_segment` allows setting `lineend`. (Jean-Olivier Irisson)
* `ggsave` raises an error when making images larger than 50x50 inches.
This prevents accidentally creating extremely large bitmap images that
hang R and eat up memory. (Winston Chang. Fixes #517)
* `train_cartesian` and `train_trans` are no longer memoized. Previously
the results of these functions were saved and so they would not
respond changes in the operating environment, such as a change in
locale. (Winston Chang. Fixes #592)
* In `stat_ydensity` and `geom_violin`, the `scale` argument now accepts
the value "width", for equal widths. Additionally `scale="equal"` has
been deprecated, in favor of "area". (Jean-Olivier Irisson)
* `stat_quantile` now supports `rqss`.
* `scale_size_area` has been added as a replacement for `scale_area`. This
makes the naming more consistent. The new scale also by default makes the
area of points proportional to the value, which is different from what
`scale_area` does. (Fixes #635)
* Functions now have gradual deprecation behavior with the `gg_dep` function.
* Scales for required but missing aesthetics (x and y) are now automatically
added. (Fixes #676)
* `geom_crossbar` previous raised a warning when notches were used and the
notches went outside the hinges. This has been changed to a message.
BUG FIXES
* With `geom_segment`, when a variable mapped to `linetype` had an NA
value, it would raise an error. This is now fixed. (Winston Chang.
Fixes #623)
* When using `coord_map` with some projections, latitude lines wrapped
around the globe and added extra lines. (Winston Chang. Fixes #562)
* `stat_summary` now calculates a unique value at each x. (Winston
Chang. Fixes #622)
* Colorbar guides now supports language objects returned from functions
like `math_format()`, and will render them as expressions. (Kohske
Takahashi)
* When using `coord_polar`, NA or NaN values caused errors. They are now
ignored instead. (Winston Chang)
* Text theme elements used in `guide_legend`, such as `label.theme`, caused
confusing errors when the angle wasn't set. Now it produces a more
informative error message.
* Theme elements now have their subclass listed first, before the `element`
class. (Thanks to Jeffrey Arnold)
* Previously when free scales were used with non-cartesian coords, they just
wouldn't work. Now ggplot throws an error with an informative message.
(Fixes #673)
* `geom_dotplot` previously worked with `position="dodge", but did not work
when using `position=position_dodge()`. It now works with both. (Fixes
#709)
* For linetype scales, NA values previously caused errors. Now `na.value`
for linetype scales defaults to "blank". (Fixes #711)
ggplot2 0.9.2.1
----------------------------------------------------------------
BUG FIXES
* find_global now searches for objects in the namespace environment
instead of the package environment. This fixes problems when ggplot2
is imported to another package but not attached.
ggplot2 0.9.2
----------------------------------------------------------------
THEME SYSTEM
* The theme system has been completely rewritten. (Winston Chang)
* The functions `theme_text`, `theme_line`, and so on have been renamed to
`element_text`, `element_line`, and so on.
* The `opts()` function has been renamed to `theme()`.
* To set the plot title, use `labs(title = "...")` or `ggtitle("...")
instead of `opts(title = "...")`.
* Elements are now just lists of properties, instead of functions that
return grobs.
* Theme elements now can inherit properties. For example, `axis.title.x`
inherits properties from `axis.title`, which in turn inherits from
`text`. The inheritance tree is stored in ggplot2::.element_tree.
* Theme objects can now be added to each other with `+`, without a ggplot
object. There is also a new `%replace%` operator for adding theme
objects together.
* Vertical and horizontal grid lines can now be controlled independently,
with `axis.grid.major.x`, `axis.grid.major.y` (and the same for minor);
`axis.ticks.x` and `axis.ticks.y`; and `axis.line.x` and `axis.line.y`.
* The `size` property of theme elements can be defined relative to the
parent objects, using the `rel()` function.
MINOR FEATURES
* ggplot2 now uses the external gtable package instead of internal gtable
functions.
* The condition that set parameters (e.g. `colour = "red"`) could only be of
length one has been relaxed - they may now be of length one, or exactly the
same length as the data. Recycling is not done because it makes it harder to
spot problems. This makes `annotate` considerably more flexible. (Fixes
#489)
* `stat_contour` is now somewhat faster
* new stat class `stat_ecdf` that shows empirical cumulative distribution
function. (Kohske Takahashi)
* Dependency on `gpclib` removed, and `fortify.SpatialPolygonsDataFrame` will
now use `rgeos` if available - this is particularly useful if you're not
able to use the non-free `gpclib`.
* `ggsave` now supports emf output files.
* all "template" plots (`plotmatrix`, `ggorder` etc) have been deprecated and
will be removed in a future version. These plots are poorly tested and
poorly supported and really belong in a separate package.
* The default guide for continuous color/fill scale is now colourbar.
(Kohske Takahashi. Fixes #555)
* The arrowhead of geom-path and geom-segment with `arrow = TRUE` is
now filled with the same colour as the path.
* The algorithm for calculating breaks locations has been changed from
`pretty_breaks()` to `extended_breaks()` from the 'labeling' package
by Justin Talbot. (Winston Chang. Fixes #580)
* `scale_type`, the function used to pick which type of scale should be
used for a given type of input variable is now an S3 generic. That
means that if you want to add a new default type of scale you can
provide a method - it should return a string giving the name of the
scale to use (e.g. "continuous", "discrete", "date")
* When there are multiple guides (legends), the order that they are
displayed can now be controlled manually. (Kohske Takahashi. Fixes
#470)
* When a scale for a given aesthetic is added to a plot more than once,
display a message indicating that the first scale will be replaced.
(Winston Chang. Fixes #518)
DOCUMENTATION
* All geoms and stats now document their aesthetics. (Thanks to joranE.
Fixes #447)
BUG FIXES
* `scale_x_continuous` now respects `na.value` (Fixes #522)
* `geom_map` now correctly uses set aesthetics (e.g. `colour = "green"`)
* Setting breaks outside the limits of the x or y axis no longer causes
errors. (Kohske Takahashi. Fixes #552)
* `facet_locate` no longer evaluates unneeded expressions. (Winston
Chang. Fixes #565)
* `annotation_map` now gets group id from munched data. (Winston Chang.
Fixes #568)
* `geom_raster` now supports alpha. (Kohske Takahashi. Fixes #596)
* Both axis lines are now drawn above the plotting area panel.
(Winston Chang. Fixes #585)
* The jitter resolution is now correctly calculated when the data
does _not_ include zero. (Thanks to Karl Ove Hufthammer. Fixes #572)
* Legend icons for `geom_boxplot` now display linetype. (Kohske
Takahashi. Fixes #608)
* Facets now appear in the correct order when layers with different
factor levels are added. (Winston Chang. Fixes #543)
* Distances in polar coordinates are calculated along spiral arcs,
instead of straight-line distance. (Winston Chang. Fixes #471)
* `fortify.SpatialPolygonsDataFrame` now uses the correct ordering.
(Charlotte Wickham. Fixes #434)
* `stat_vline` and `stat_hline` no longer throw errors when
`xintercept` and `yintercept` are passed to them. (Winston Chang.
Fixes #624)
ggplot2 0.9.1
----------------------------------------------------------------
MINOR FEATURES
* `ggstructure` and `ggorder`, which call `ggpcp`, no longer have a
`scale` argument since `ggpcp` does not have one.
* built in datasets have been checked to make sure they use characters,
factors and ordered factors appropriately
* `geom_raster` and `annotation_raster` gain new `interpolate` argument for
controlling whether or not rasters are interpolated
* Added `plot` as an alias for `print` for ggplot objects.
* Visual tests have been moved to /visual_test and modified to work with the
vtest package. (Thanks to Winston Chang)
* `geom_dotplot`: now supports stacking. It uses `stackgroups = TRUE` instead
of the usual position="stack", for technical reasons. It also will stack in
the x direction when binning along the y axis. (Thanks to Winston Chang)
* `geom_rug` now allows control over which sides to put the rug lines, with
the `sides` argument. (Thanks to Winston Chang)
* `annotation_logticks`: a new geom that adds tick marks on the inside of the
plotting rectangle that have diminishing spacing for log-10 axes. (Thanks
to Winston Chang)
* Coordinate expansion is now handled by an interaction of the scale and
coord, rather than by the scale only. Also, the `wise` argument is no
longer needed. (Thanks to Winston Chang and Kohske Takahashi)
BUG FIXES
* `facet_grid` no longer drops duplicate cases (Fixes #443)
* `munch_range` properly reports the x and y range. (Thanks to Winston Chang)
* `stat_bin2d` handles data with NA in the position variables. Error was
triggered when scale was limited to a range smaller than the range of
the data. (Bug reported by Tao Gao; diagnosed and fixed by Brian Diggs)
* `scale_*_identity` will now produce a legend when `guide = "legend"` and no
breaks or labels are supplied (Fixes #453)
* `geom_map` now works with `coord_map` (Fixes #480)
* discrete scales now accept named vectors of labels again (Fixes #427)
* `geom_raster` works better with categorical input (Fixes #463)
* `qplot` no longer uses non-standard evaluation for geom/stat arguments - it
doesn't seem to be needed and was causing problems when qplot was used in
special environments (e.g. in knitr) (Fixes #377)
* `coord_train.polar` and `coord_train.trans` remove NAs from breaks.
(Thanks to Winston Chang. Fixes #422)
* Theta breaks with `coord_polar` have equal angular spacing. (Thanks to
Winston Chang and Kohske Takahashi. Fixes #288)
* Empty data frames are now handled correctly: layers with empty data are
dropped silently, instead of inheriting data from the plot. (Thanks to
Winston Chang. Fixes #31, #332, #506 and #507)
* The alpha value of set colours is now preserved by default. To return to the
old behaviour, set `alpha = 1`. (Fixes #475)
* `scale_*_manual` will throw an error if you have too few values. (Fixes
#512)
* `facet_wrap` gets the `as.table` argument back. (Fixes #497)
* `resolution` now returns 1 when range is zero. (Fixes #526)
* Titles are displayed above legend when legend is on top. (Thanks to
Kohske Takahashi. Fixes #432)
* Specifying breaks outside coord limits works. (Thanks to Kohske Takahashi.
Fixes #430)
* `renames_aes` now uses exact matching instead of partial matching. (Thanks
to Winston Chang. Fixes #529)
* `labs()` now works with American spellings. (Thanks to Winston Chang.
Fixes #521)
* `stat_density2d` sets the limits for `kde2d` from the limits of the x and
y scales. (Thanks to Winston Chang)
ggplot2 0.9.0
----------------------------------------------------------------
NEW FEATURES
* `annotation_custom`: a new geom intended for use as static annnotations that
are the same in every panel. Can be used to add inset plots, tables, and
other grid-based decorations inside the plot area (Contributed by Baptiste
Auguié).
* `geom_map`: a new special case of `geom_polygon` useful when you are drawing
maps, particularly choropleth maps. It is matched with `annotation_map`, an
even faster special case when you want the same map drawn in each panel.
* `geom_raster` is a special case of `geom_tile` for equally sized rectangular
tiles. It uses the raster functionality of R graphics devices for massively
increased speed and much decreased file sizes. It is matched with
`annotation_raster`, an even faster special case, for when you want to draw
the same raster in each panel.
* `geom_violin`: an implementation of violin plots, which are a way of
visualizing kernel density estimates. (Thanks to Winston Chang)
* `geom_dotplot`: dot plots, as described in Wilkinson (1999). To bin the
data, it uses `stat_bindot` to bin the data, which has two methods: histodot
and dot-density. Histodot binning uses fixed-width bins just like
`stat_bin`, while dot-density binning uses variable-width bins. A new grob,
`grob_dotstack` is used to render the dots. (Thanks to Winston Chang)
* New fortify methods have been added for objects produced by the `multcomp`
package.
* `stat_summary2d` and `stat_summary_hex`. These are work like `stat_bin2d`
and stat_binhex but allow any summarisation function (instead of just
count). They are 2d analogs of `stat_summary`
* `facet_grid`: The space argument now supports `free_x` and `free_y` next to
`free` and `fixed, this allows the user to adjust the spatial scaling of the
facets in either the x or y direction. This is especially useful when the
scales are very different. In this case space = `free` could make some
facets very small. (Thanks to Willem Ligtenberg)
DOCUMENTATION
* Thorough clean up and checking, including documenting all arguments, adding
systematic cross-references, and adding commonly requested examples. Thanks
to Jake Russ and Dennis Murphy for the help.
* Complete series of aesthetics pages (grouped subsets of aesthetics) with
examples of how to use the major ones, see e.g. `?fill`, `?shape`, `?x`,
* Added a complete list of theme opts with usage examples in `?opts`
* Added "translate" pages to demonstrate usage between qplot and ggplot, GPL,
base and lattice graphics: `?translate_qplot_base`, `?translate_qplot_gpl`,
`?translate_qplot_lattice`, `?translate_qplot_ggplot`,
SCALES
* Scales have been rewritten to use the new `scales` package, which does a
much better job at defining what a scale is and making it easier for you to
create your own scales. Scales should now behave much more consistently, and
it should be easier for me to add new features in the future.
* `breaks` parameter can now be a function, which will be passed the scale
limits and expected to return a character vector of breaks
* `labels` parameter can now be a function - this replaces the previous
formatter function that only some scales possessed, and the `major` argument
to the data time scales. This function should take a vector of breaks as
input, and return a character vector or list of expressions as output. See
`comma_format`, `dollar_format`, `percent_format`, `scientific_format`,
`parse_format` and `math_format` for examples
* Transformations are now provided by the scales package - see `?trans_new`
for list of available transformations, and how to create your own. The
transformations in this package should do a better job at computing default
breaks.
* Transformations for continuous scales are now detected automatically when
the default scales are added. This ensures that dates and date times will
display correctly when used for any aesthetic - previously they only worked
with position scales. The system is now also easier to extend to new types
of continuous data that you might want to plot. (Fixes #48)
* All scales now accept a `na.value` parameter which provides an aesthetic
value to be used for `NA` values in the data. Colour/fill scales default to
grey, which should stand out as different from non-missing values.
* The new `oob` (out of bounds) parameter controls how scales deals with
values outside the limits. The default action is `censor` - see `clip` for
another option.
* Only `scale_x_log10`, `scale_x_sqrt` and `scale_x_reverse` provided as
convenience functions for x and y scales. Use e.g. `scale_x_continuous(trans
= "log")` to access others
* `set_default_scale` has been removed. If you want to change the default
scale for an aesthetic, just create a function called
`scale_aesthetic_continuous` or `scale_aesthetic_discrete` that returns the
scale that you want. For example:
p <- qplot(mpg, wt, data = mtcars, colour = factor(cyl))
p
scale_colour_discrete <- scale_colour_brewer
p
* Scales now automatically shrink to what is actually displayed on the plot,
not the underlying data used for statistical transformation. If you want the
old behaviour, supply `shrink = FALSE` to the facetting specification.
(Fixes #125)
* `scale_colour_gradient` and `scale_fill_gradient` now use a colour scheme
with constant hue but varying chroma and luminance. This is better because
it creates a natural ordering inline with the order of the colour values.
FACETS
* Converted from proto to S3 objects, and class methods (somewhat) documented
in `facet.r`. This should make it easier to develop new types of facetting
specifications.
* The new `facet_null` specification is applied in the default case of no
faceting. This special case is implemented more efficiently and results in
substantial performance improvements for non-facetted plots.
* Facetting variables will no longer interfere with aesthetic mappings -
`facet_wrap(~ colour)` will no longer affect the colour of points.
DEVELOPMENT
* ggplot2 has moved away from the two (!!) homegrown documentation systems
that it previously relied on, and now uses roxygen extensively. The current
downside is that this means that ggplot2 website can no longer be updated,
but I hope work with the `helpr` package will resolve that shortly.
* ggplot2 now uses a `NAMESPACE`, and only exports functions that should be
user visible - this should make it play considerably more nicely with other
packages in the R ecosystem. Note that this means you now need to explicitly
load `plyr` (and other packages) if you are using them elsewhere in your
code.
* ggplot2 now has a start on a set of automated tests. As this test suite
expands it will help me ensure that bugs stay fixed, and that old bugs don't
come back in new versions. A test suite also gives me more confidence when
I'm modifying code, which should help with general code quality.
COORDS
* Converted from proto to S3 objects, and class methods (somewhat) documented
in `coord.r`. This should make it easier to develop new types of coordinate
systems.
* Added a new method `coord_range` for finding the x and y range even after
coordinates have been transformed to other names (eg., theta and r). (Thanks
to Winston Chang)
RENDERING
* When printing a ggplot2 object, the rendered plot information is returned
invisibly. You can capture this with (e.g.) `x <- print(qplot(mpg, wt, data
= mtcars))` and in the future will be able to use it to get information
about the plot computations, such as the range of all the scales, and the
exact data that is plotted.
* Drawing a plot takes place in three documented steps: `ggplot_build` which
creates a list of data frames ready for rendering builds, `ggplot_gtable`
which creates a `gtable` of grobs, and `grid.draw` which renders the grobs
on screen. Each of these returns a data structure which should be useful for
understanding and modifying the rendered plot. This is still a work in
progress, so please ask questions if anything is confusing.
* The `drop` and `keep` parameters to `ggsave` and `print.ggplot` have been
dropped, as the data structure returned by `ggplot_gtable` is sufficiently
rich enough to remove the need for them.
* Axis labels are now centred underneath the panels (not the whole plot), and
stick close to the panels regardless of the aspect ratio.
GUIDES
* Guides (particularly legends) have been rewritten by Kohske Takahashi to
provide considerably more layout flexibility.
* `guide_legend` now supports multi-row/column legend and reversed order,
gives more flexible positioning of title and label, and can override
aesthetics settings. This is useful, for example, when alpha value in a
panel is very low but you want to show vivid legend.
* `guide_colorbar` is a guide specially for continuous colour scales as
produced by colour and fill scales.
MINOR CHANGES
* `geom_text` now supports `fontfamily`, `fontface`, and `lineheight`
aesthetics for finer control over text display. (Thanks to Kohske Takahashi
for the patch. Fixes #60)
* `collide`, which powers `position_dodge` and `position_stack`, now does not
error on single x values (Thanks to Brian Diggs for a fix. #157)
* `...` in `ggplot` now passed on to `fortify` method when used with an object
other than a data frame
* `geom_boxplot`: outlier colour and shape now default to values set by the
aesthetic mapping (thanks to suggestion by Ben Bolker), the width of the
median line is now `fatten` times the width of the other lines (thanks to
suggestion by Di Cook), and the line type can now be set. Notched box
plots are now supported by setting `notch = TRUE` (thanks to Winston Chang
for the patch).
* `ggsave` can work with cm and mm `units` (Thanks to patch from Jean-Olivier
Irisson)
* `scale_shape` finally returns an error when you try and use it with a
continuous variable
* `stat_contour` no longer errors if all breaks outside z range (fixes #195).
* `geom_text` remove rows with missing values with warning (fixes #191)
* New generic function `autoplot` for the creation of complete plots
specific to a given data structure. Default implementation throws
an error. It is designed to have implementations provided by other
packages. (Thanks to suggestion by Brian Diggs)
* `ggpcp` loses the `scale` argument because it relied on reshape(1) code
* `map_data` passes `...` on to `maps::map` (Fixes #223)
* `coord_fixed` accepts `xlim` and `ylim` parameters to zoom in on x and y
scales (Fixes #91)
* ggplot2 will occasionally display a useful hint or tip on startup. Use
`suppressPackageStartupMessages` to eliminate
* `stat_binhex` uses correct bin width for computing y axis bounds. (Fixes
#299, thanks to Dave Henderson for bug report and fix.)
* `stat_smooth` now adjusts confidence intervals from `loess` using a
t-based approximation
* `stat_smooth` reports what method is used when method is "auto". It also
picks the method based on the size of the largest group, not individually by
group. (Thanks to Winston Chang)
* `stat_bin` and `geom_histogram` now use right-open, left-closed intervals by
default. Use `right = TRUE` to return to previous behaviour.
* `geom_vline`, `geom_hline`, and `geom_abline` now work with non-Cartesian
coordinate systems. (Thanks to Winston Chang)
ggplot2 0.8.9
----------------------------------------------------------------
A big thanks to Koshke Takahashi, who supplied the majority of improvements
in this release!
GUIDE IMPROVEMENTS
* key size: can specify width and height separately
* axis: can partially handle text rotation (issue #149)
* legend: now can specify the direction of element by opts(legend.direction =
"vertical") or opts(legend.direction = "horizontal"), and legend box is
center aligned if horizontal
* legend: now can override the alignment of legend box by
opts(legend.box = "vertical") or opts(legend.box = "horizontal")
* legend: now can override legend title alignment with opts(legend.title.align
= 0) or opts(legend.title.align = 1)
* legend: can override legend text alignment with opts(legend.text.align = 0)
or opts(legend.text.align = 1)
BUG FIXES
* theme_*: can specify font-family for all text elements other than geom_text
* facet_grid: fixed hirozontal spacing when nrow of horizontal strip >= 2
* facet_grid: now can manually specify the relative size of each row and column
* is.zero: now correctly works
* +: adding NULL to a plot returns the plot (idempotent under addition)
(thanks to suggestion by Matthew O'Meara)
* +: meaningful error message if + doesn't know how to deal with an object
type
* coord_cartesian and coord_flip: now can wisely zoom when wise = TRUE
* coord_polar: fix point division bugs
* facet_grid: now labels in facet_grid are correctly aligned when the number
of factors is more then one (fixes #87 and #65)
* geom_hex: now correctly applies alpha to fill colour not outline colour
(thanks to bug report from Ian Fellows)
* geom_polygon: specifying linetype now works (thanks to fix from Kohske
Takahashi)
* hcl: can now set c and l, and preserves names (thanks to suggestion by
Richard Cotton)
* mean_se: a new summary function to work with stat_summary that calculates
mean and one standard error on either side (thanks to contribution from
Kohske Takahashi)
* pos_stack: now works with NAs in x
* scale_alpha: setting limits to a range inside the data now works (thanks to
report by Dr Proteome)
* scale_colour_continuous: works correctly with single continuous value (fixes
#73)
* scale_identity: now show legends (fix #119)
* stat_function: now works without y values
* stat_smooth: draw line if only 2 unique x values, not three as previously
* guides: fixed #126
* stat_smooth: once again works if n > 1000 and SE = F (thanks to bug report
from Theiry Onkelinx and fix from Kohske Takahashi)
* stat_smooth: works with locfit (fix #129)
* theme_text handles alignment better when angle = 90
ggplot2 0.8.8
----------------------------------------------------------------
Bug fixes:
* coord_equal finally works as expected (thanks to continued prompting from
Jean-Olivier Irisson)
* coord_equal renamed to coord_fixed to better represent capabilities
* coord_polar and coord_polar: new munching system that uses distances (as
defined by the coordinate system) to figure out how many pieces each segment
should be broken in to (thanks to prompting from Jean-Olivier Irisson)
* fix ordering bug in facet_wrap (thanks to bug report by Frank Davenport)
* geom_errorh correctly responds to height parameter outside of aes
* geom_hline and geom_vline will not impact legend when used for fixed
intercepts
* geom_hline/geom_vline: intercept values not set quite correctly which
caused a problem in conjunction with transformed scales (reported by Seth
Finnegan)
* geom_line: can now stack lines again with position = "stack" (fixes #74)
* geom_segment: arrows now preserved in non-Cartesian coordinate system (fixes
#117)
* geom_smooth now deals with missing values in the same way as geom_line
(thanks to patch from Karsten Loesing)
* guides: check all axis labels for expressions (reported by Benji Oswald)
* guides: extra 0.5 line margin around legend (fixes #71)
* guides: non-left legend positions now work once more (thanks to patch from
Karsten Loesing)
* label_bquote works with more expressions (factors now cast to characters,
thanks to Baptiste Auguie for bug report)
* scale_color: add missing US spellings
* stat: panels with no non-missing values trigged errors with some statistics.
(reported by Giovanni Dall'Olio)
* stat: statistics now also respect layer parameter inherit.aes (thanks to bug
report by Lorenzo Isella and investigation by Brian Diggs)
* stat_bin no longer drops 0-count bins by default
* stat_bin: fix small bug when dealing with single bin with NA position
(reported by John Rauser)
* stat_binhex: uses range of data from scales when computing binwidth so hexes
are the same size in all facets (thanks to Nicholas Lewin-Koh for the bug
report)
* stat_qq has new dparam parameter for specifying distribution parameters
(thanks to Yunfeng Zhang for the bug report)
* stat_smooth now uses built-in confidence interval (with small sample
correction) for linear models (thanks to suggestion by Ian Fellows)
* stat_spoke: correctly calculate stat_spoke (cos and sin were flipped, thanks
to Jean-Olivier Irisson for bug report and fix)
ggplot2 0.8.7
----------------------------------------------------------------
* coord_map gains xlim and ylim arguments to control region of projection
* corrected label generation for computed aesthetics (..x..) and special
names (`x x`)
* fullseq: now always returns vector of length two, even when range is 0
* geom_point legend takes more care to ensure that fill colours will be shown
* legend: fixed scale merging bug when labels were set manually
* scale_area: gains a legend argument like all other scales
* scale_colour_brewer: gains na.colour argument to set colour of missing
values
* stat_bin2d: fix typo in breaks calculation
* stat_bin: deals with floating point rounding issues using the same
algorithm as base::hist
* stat_density2d: fixed bug when contour = FALSE (Thanks to Takahashi Kohske)
ggplot2 0.8.6
----------------------------------------------------------------
NEW FEATURES
* trans_log1p: new log + 1 transformer contributed by Jean-Olivier Irisson
BUG FIXES
* aesthetics: fixed bug when overriding aesthetics with NULL
* annotate: adds layers with legend = FALSE
* coord_equal: correctly place tick marks (Fixes #61)
* documentation: usage statements should now be spread over multiple lines
* fortify.SpatialPolygonsDataFrame: fixed bug when region variable had missing values
* legend: don't try and display legend when unnecessary scale added
* legend: text labels now correctly left-aligned when non-numeric
* order aesthetic now correctly affects position adjustments (Fixes #70)
* qplot loads facetting variables from global environment more correctly
* scale_date and scale_date_time now work with infinite positions
* scale_date and scale_date_time now take expand argument
* scales were not getting automatically added in many situations (Fixes #69)
* scale_manual was not returning labels in the correct format and so legends
were not getting merged correctly
* stat_contour: fix error if x or y coordinates were negative
* stat_bin: now copes with bars of zero height (Fixes #72)
* stat_qq: always use sorted data (rather than interpolated quantiles) on
sample axis. This makes it behave more like qqnorm
* stat_quantile: correctly group results
* xlim now works with datetimes
* all plyr functions prefixed with their namespace to avoid clashes with other
packages (thanks to Steve Lianoglou)
ggplot2 0.8.5
----------------------------------------------------------------
NEW FEATURES
* geom_text gains parse argument which makes it possible to display
expressions. (Implements #50)
* all scales now have legend parameter, which defaults to TRUE. Setting to
false will prevent that scale from contributing to the legend (Implements
#27)
* default axis labels and legend titles are now stored in the options, instead
of in each scale. This fixes a long standing bug where it was not easy to
set the label for computed variable, such as the y axis on a histogram.
Additionally, it means default scales are only added to the plot until just
prior to plotting, instead of the previous behaviour where scales where
added as layers were added - this could cause problems if you later modified
the underlying data. (Implements #28)
* coord_equal: when ratio = NULL (the default), it will adjust the aspect
ratio of the plot, rather than trying to extend the shortest axis.
* x and y positions can be set to Inf or -Inf to refer to the top/right and
bottom/left extents of the panel. (Implements #18)
* expand_limits(): a new function to make it easy to force the inclusion of
any set of values in the limits of any aesthetic.
NEW FEATURES (MINOR)
* aesthetics: when _setting_ an aesthetic, you may only set it to a single
value. This was always a good idea, but now it is enforced with an
informative error message.
* stat_contour bump up default number of contours
* stat_density2d: make number of grid points used for density estimation
user controllable (implements #9)
* geom_bin now allows you to set whether bins used intervals of the form
(a, b] or [a, b) with the "right" parameter (implements #20)
* geom_path: linejoin, lineend and linemitre are now user controllable
(implements #24)
* scales: all scales check that breaks are supplied if labels are, and
that breaks and labels are the same length (implements #40)
* scales: if breaks are a named vector, the names will be used as labels
(thanks to suggestion by David Kahle)
* scale_colour_gradient, scale_colour_gradient2 & scale_colour_gradientn now
have formatter argument to match scale_continuous
* updated citation to refer to the ggplot2 book
BUG FIXES
* coord_cartesian now correctly sets limits when one or both of the position
scales are non-linear. (fixes #17)
* coord_equal: now works with non-linear scales (fixes #13)
* coord_map sets aspect ratio correctly (fixes #4)
* coord_polar correctly combines labels on end of axis if expressions
(fixes #39)
* coord_trans now respects scale expand parameter (expansion occurs after
transformation) (fixes #14)
* facet_grid with scales = "free" and space = "free" now calculates space
correctly if the range of the scale is < 1 (fixes #1)
* facet_grid works once more when facetting with multiple variables in one
direction (fixes #11)
* facet_wrap now sets aspect ratio correctly
* facet_wrap now maintains original order of data
* geom_hline and geom_vline now work with coord_flip (fixes #30)