Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ where the formatting is also better._
the functions called rather than just their names. (#504 @zeileis)
- Legend labels are now correct if `by` is logical. Thanks to @TCornulier for
the report. (#512 @grantmcdermott)
- Axis limits are now correctly calculated for factor (and character) variables,
by coercing to numeric first. We also avoid the redundancy of re-calculating
axis limits for secondary plot layers. (#513 @grantmcdermott)

### Documentation

Expand Down
8 changes: 4 additions & 4 deletions R/lim.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ lim_args = function(settings) {
}

if (is.null(xlim)) {
xlim = range(c(
xlim = range(as.numeric(c(
datapoints[["x"]], datapoints[["xmin"]],
datapoints[["xmax"]]), finite = TRUE)
datapoints[["xmax"]])), finite = TRUE)
}
if (is.null(ylim)) {
ylim = range(c(
ylim = range(as.numeric(c(
datapoints[["y"]], datapoints[["ymin"]],
datapoints[["ymax"]]), finite = TRUE)
datapoints[["ymax"]])), finite = TRUE)
}

if (identical(type, "boxplot")) {
Expand Down
5 changes: 3 additions & 2 deletions R/tinyplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,9 @@ tinyplot.default = function(
#

# do this after computing yaxb because limits will depend on the previous calculations
lim_args(settings)

if (!add) {
lim_args(settings)
}

#
## facets: count -----
Expand Down