From 31ddee825e12f32ab698b7ddeb4682e6f63ea82f Mon Sep 17 00:00:00 2001 From: Christoph Jansen Date: Sat, 6 Oct 2018 14:45:30 +0200 Subject: [PATCH] added vmin and vmax arguments --- combination_triangles_plot/main.py | 18 +++++++++++++++++- combination_triangles_plot/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/combination_triangles_plot/main.py b/combination_triangles_plot/main.py index 15d0c10..1c1f9f9 100644 --- a/combination_triangles_plot/main.py +++ b/combination_triangles_plot/main.py @@ -72,6 +72,14 @@ def attach_args(parser): '--label-ur-y', action='store', type=float, metavar='LABEL_UR_Y', default=-3.5, help='Y position of upper right (ur) label.' ) + parser.add_argument( + '--vmin', action='store', type=float, metavar='VMIN', + help='Scale minimum. Default is the minimum value across all plots.' + ) + parser.add_argument( + '--vmax', action='store', type=float, metavar='VMAX', + help='Scale maximum. Default is the maximum value across all plots.' + ) def main(): @@ -96,7 +104,9 @@ def run( label_ll_x, label_ll_y, label_ur_x, - label_ur_y + label_ur_y, + vmin, + vmax ): if len(tick_separator) > 1: raise Exception('expected single character as TICK_SEPARATOR') @@ -124,6 +134,12 @@ def run( vmin_total = min(min_lower, min_upper, vmin_total) vmax_total = max(max_lower, max_upper, vmax_total) + if vmin is not None: + vmin_total = vmin + + if vmax is not None: + vmax_total = vmax + center = 0 cmap = 'RdBu' if vmin_total >= 0: diff --git a/combination_triangles_plot/version.py b/combination_triangles_plot/version.py index d0bd79f..68c0733 100644 --- a/combination_triangles_plot/version.py +++ b/combination_triangles_plot/version.py @@ -1 +1 @@ -VERSION = '0.1' +VERSION = '0.2' diff --git a/pyproject.toml b/pyproject.toml index 666ad9e..e6ae57c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "combination-triangles-plot" -version = "0.1" +version = "0.2" authors = ["Christoph Jansen "] license = "AGPL-3.0" readme = "README.md"