Skip to content

Commit

Permalink
use integers in x-axis breaks for racing autoplot()s (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Jan 19, 2024
1 parent caf6416 commit 4d0fda5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# finetune (development version)

* `autoplot()` methods for racing objects will now use integers in x-axis breaks (#75).

* Enabling the `verbose_elim` control option for `tune_race_anova()` will now additionally introduce a message confirming that the function is evaluating against the burn-in resamples.

* Updates based on the new version of tune, primarily for survival analysis models.
Expand Down
9 changes: 8 additions & 1 deletion R/plot_race.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ plot_race <- function(x) {
ggplot2::ggplot(ggplot2::aes(x = stage, y = mean, group = .config, col = .config)) +
ggplot2::geom_line(alpha = .5, show.legend = FALSE) +
ggplot2::xlab("Analysis Stage") +
ggplot2::ylab(metric)
ggplot2::ylab(metric) +
ggplot2::scale_x_continuous(breaks = integer_breaks)
}

integer_breaks <- function(lims) {
breaks <- pretty(lims)

unique(round(breaks))
}

stage_results <- function(ind, x) {
Expand Down

0 comments on commit 4d0fda5

Please sign in to comment.