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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tinyplot
Type: Package
Title: Lightweight Extension of the Base R Graphics System
Version: 0.5.0
Version: 0.5.0.99
Date: 2025-09-21
Authors@R:
c(
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ _If you are viewing this file on CRAN, please check the
[latest NEWS](https://grantmcdermott.com/tinyplot/NEWS.html) on our website
where the formatting is also better._

## Dev version

### Bug fixes

- For bubble plots, we now drop the minimum legend category (label) if it is
equal to 0. The previous behaviour was just an artifact of the `pretty` breaks
algorithm that we use to create discrete legend categories. The interior plot
elements, e.g. bubble points, are unaffected. (#498 @grantmcdermott)

## 0.5.0

### New features
Expand Down
5 changes: 5 additions & 0 deletions R/type_points.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ data_points = function(clim = c(0.5, 2.5)) {
cex = rescale_num(sqrt(c(bubble_labs, cex))/pi, to = clim)
bubble_cex = cex[1:len_labs]
cex = cex[(len_labs+1):length(cex)]
# catch for cases where pretty breaks leads to smallest category of 0
if (bubble_labs[1] == 0) {
bubble_labs = bubble_labs[-1]
bubble_cex = bubble_cex[-1]
}
names(bubble_cex) = format(bubble_labs)
if (max(clim) > 2.5) {
legend_args[["x.intersp"]] = max(clim) / 2.5
Expand Down
5 changes: 5 additions & 0 deletions R/type_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ data_text = function(labels, clim = c(0.5, 2.5)) {
cex = rescale_num(sqrt(c(bubble_labs, cex)) / pi, to = clim)
bubble_cex = cex[1:len_labs]
cex = cex[(len_labs + 1):length(cex)]
# catch for cases where pretty breaks leads to smallest category of 0
if (bubble_labs[1] == 0) {
bubble_labs = bubble_labs[-1]
bubble_cex = bubble_cex[-1]
}
names(bubble_cex) = format(bubble_labs)
if (max(clim) > 2.5) {
legend_args[["x.intersp"]] = max(clim) / 2.5
Expand Down
31 changes: 10 additions & 21 deletions inst/tinytest/_tinysnapshot/bubble_dual_continuous.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 10 additions & 21 deletions inst/tinytest/_tinysnapshot/bubble_dual_discrete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 23 additions & 34 deletions inst/tinytest/_tinysnapshot/bubble_dual_fancy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading