Skip to content

Commit

Permalink
Merge pull request #107 from orichters/emptylegend
Browse files Browse the repository at this point in the history
avoid empty legends in mipArea
  • Loading branch information
orichters authored Jul 11, 2024
2 parents ffcf654 + 7034550 commit 20b62e1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '29670370'
ValidationKey: '29693265'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'mip: Comparison of multi-model runs'
version: 0.149.0
date-released: '2024-07-09'
version: 0.149.1
date-released: '2024-07-11'
abstract: Package contains generic functions to produce comparison plots of multi-model
runs.
authors:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mip
Title: Comparison of multi-model runs
Version: 0.149.0
Date: 2024-07-09
Version: 0.149.1
Date: 2024-07-11
Authors@R: c(
person("David", "Klein", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
5 changes: 4 additions & 1 deletion R/shorten_legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ shorten_legend <- function(x, maxchar = 20, identical_only = FALSE, # nolint: o
}

if (! is.null(ylab)) {
# shorten labels by variable part of ylab
ylabvariable <- magclass::unitsplit(ylab)$variable
x <- gsub("^\\|", "", gsub(ylabvariable, "", x, fixed = TRUE))
x_tmp <- gsub("^\\|", "", gsub(ylabvariable, "", x, fixed = TRUE))
# avoid empty labels
x <- ifelse(x_tmp == "", x, x_tmp)
} else {
sep_or <- paste0("\\", sep, collapse = "|")
sep_no <- paste0("[^", paste0("\\", sep, collapse = ""), "]")
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Comparison of multi-model runs

R package **mip**, version **0.149.0**
R package **mip**, version **0.149.1**

[![CRAN status](https://www.r-pkg.org/badges/version/mip)](https://cran.r-project.org/package=mip) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158586.svg)](https://doi.org/10.5281/zenodo.1158586) [![R build status](https://github.com/pik-piam/mip/workflows/check/badge.svg)](https://github.com/pik-piam/mip/actions) [![codecov](https://codecov.io/gh/pik-piam/mip/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mip) [![r-universe](https://pik-piam.r-universe.dev/badges/mip)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -47,7 +47,7 @@ In case of questions / problems please contact David Klein <[email protected]

To cite package **mip** in publications use:

Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O, Rüter T (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.149.0, <https://github.com/pik-piam/mip>.
Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O, Rüter T (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.149.1, <https://github.com/pik-piam/mip>.

A BibTeX entry for LaTeX users is

Expand All @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is
title = {mip: Comparison of multi-model runs},
author = {David Klein and Jan Philipp Dietrich and Lavinia Baumstark and Florian Humpenoeder and Miodrag Stevanovic and Stephen Wirth and Pascal Führlich and Oliver Richters and Tonn Rüter},
year = {2024},
note = {R package version 0.149.0},
note = {R package version 0.149.1},
url = {https://github.com/pik-piam/mip},
doi = {10.5281/zenodo.1158586},
}
Expand Down
9 changes: 7 additions & 2 deletions man/plotstyle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 20b62e1

Please sign in to comment.