File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 11# ggplot2 (development version)
22
3+ * Fix a bug in ` stat_contour_filled() ` where break value differences below a
4+ certain number of digits would cause the computations to fail (@thomasp85 ,
5+ #4874 )
6+
37* ` stage() ` now properly refers to the values without scale transformations for
48 the stage of ` after_stat ` . If your code requires the scaled version of the
59 values for some reason, you have to apply the same transformation by yourself,
Original file line number Diff line number Diff line change @@ -328,11 +328,17 @@ iso_to_polygon <- function(iso, group = 1) {
328328# ' @noRd
329329# '
330330pretty_isoband_levels <- function (isoband_levels , dig.lab = 3 ) {
331- interval_low <- gsub(" :.*$" , " " , isoband_levels )
332- interval_high <- gsub(" ^[^:]*:" , " " , isoband_levels )
331+ interval_low <- as.numeric( gsub(" :.*$" , " " , isoband_levels ) )
332+ interval_high <- as.numeric( gsub(" ^[^:]*:" , " " , isoband_levels ) )
333333
334- label_low <- format(as.numeric(interval_low ), digits = dig.lab , trim = TRUE )
335- label_high <- format(as.numeric(interval_high ), digits = dig.lab , trim = TRUE )
334+ breaks <- unique(c(interval_low , interval_high ))
335+
336+ while (anyDuplicated(format(breaks , digits = dig.lab , trim = TRUE ))) {
337+ dig.lab <- dig.lab + 1
338+ }
339+
340+ label_low <- format(interval_low , digits = dig.lab , trim = TRUE )
341+ label_high <- format(interval_high , digits = dig.lab , trim = TRUE )
336342
337343 # from the isoband::isobands() docs:
338344 # the intervals specifying isobands are closed at their lower boundary
You can’t perform that action at this time.
0 commit comments