Skip to content

Commit

Permalink
Fix matplotlib linegraph and bargraph for the case when xmax < xmin i…
Browse files Browse the repository at this point in the history
…n config (#2124)

* Fix matplotlib linegraph and bargraph when xmax < xmin

* [automated] Update CHANGELOG.md

* pedantic

* Update multiqc/plots/boxplot.py

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
Co-authored-by: Phil Ewels <phil.ewels@seqera.io>
  • Loading branch information
3 people committed Oct 17, 2023
1 parent 10b099a commit 363c783
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Strict mode: rename `config.lint` to `config.strict`, crash early on module or template error. Add `MULTIQC_STRICT=1` ([#2101](https://github.com/ewels/MultiQC/pull/2101))
- Trigger changelog entry addition on PR creation, in addition to an explicit comment to multiqc-bot ([#2102](https://github.com/ewels/MultiQC/pull/2102))
- Fix adding changelog entries with backticks from PR titles ([#2115](https://github.com/ewels/MultiQC/pull/2115))
- Fix matplotlib linegraph and bargraph for the case when `xmax` `<` `xmin` in config ([#2124](https://github.com/ewels/MultiQC/pull/2124))
- Add `--require-logs` flag to error out if requested modules not used ([#2109](https://github.com/ewels/MultiQC/pull/2109))
- Fix for python 3.12: replace removed `distutils` ([#2113](https://github.com/ewels/MultiQC/pull/2113))
- Bundle lzstring to fix Python 3.12 ([#2119](https://github.com/ewels/MultiQC/pull/2119))
Expand Down
2 changes: 1 addition & 1 deletion multiqc/plots/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def matplotlib_boxplot(plotdata, pconfig=None):
elif "xCeiling" in pconfig:
xmax = min(pconfig["xCeiling"], default_xlimits[1])
if (xmax - xmin) < pconfig.get("xMinRange", 0):
xmax = xmin + pconfig["xMinRange"]
xmax = xmin + pconfig.get("xMinRange", 0)
axes.set_xlim((xmin, xmax))

# Plot title
Expand Down
2 changes: 1 addition & 1 deletion multiqc/plots/linegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def matplotlib_linegraph(plotdata, pconfig=None):
elif "xCeiling" in pconfig:
xmax = min(pconfig["xCeiling"], default_xlimits[1])
if (xmax - xmin) < pconfig.get("xMinRange", 0):
xmax = xmin + pconfig["xMinRange"]
xmax = xmin + pconfig.get("xMinRange", 0)
axes.set_xlim((xmin, xmax))

# Plot title
Expand Down

0 comments on commit 363c783

Please sign in to comment.