Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix matplotlib linegraph and bargraph for the case when xmax < xmin in config #2124

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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))

### New Modules

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")
ewels marked this conversation as resolved.
Show resolved Hide resolved
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