From 9e3d960b6a378d5afa550fd3746566593750d31a Mon Sep 17 00:00:00 2001 From: Andrew Huang Date: Sat, 29 Sep 2018 20:54:24 -0700 Subject: [PATCH 1/8] Add normalization faq --- doc/FAQ.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 33dc109fc5..50df7c82e9 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -48,6 +48,22 @@ This same method is applicable to adjust the range of a color bar. Here z_col is the color bar value dimension and is bounded from 0 to 5. +**Q: How do I keep all the axes limits consistent/normalized across +all frames in a HoloMap/all elements in a layout? + +**A:** You may use the use the normalization options as specified below: + +..code:: python + # for consistent limits across frames + your_holomap.options(framewise=False) + + # for consistent limits across elements + your_layout.options(axiswise=False) + +If these options do not work, chances are, you have a DynamicMap, and so +you have to utilize the ``.redim.range()`` method aforementioned to manually +set the axes limits. + **Q: The default figure size is so tiny! How do I enlarge it?** **A:** Depending on the selected backend... From 013d3e0f0147418775b50b65eebfdf48be801fe2 Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 08:19:38 -0500 Subject: [PATCH 2/8] Clarified normalization --- doc/FAQ.rst | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 50df7c82e9..156f68184a 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -48,21 +48,42 @@ This same method is applicable to adjust the range of a color bar. Here z_col is the color bar value dimension and is bounded from 0 to 5. -**Q: How do I keep all the axes limits consistent/normalized across -all frames in a HoloMap/all elements in a layout? +**Q: How do I control the auto-ranging/normalization of axis limits +across frames in a HoloMap or objects in a Layout?** -**A:** You may use the use the normalization options as specified below: +**A:** Where feasible, HoloViews defaults to normalizing axis ranges +across all objects that are presented together, so that they can be +compared directly. If you don't want objects that share a dimension to +be normalized together in your layout, you can change the `axiswise` +normalization option to True, making each object be normalized +independently: ..code:: python - # for consistent limits across frames - your_holomap.options(framewise=False) + your_layout.options(axiswise=True) - # for consistent limits across elements - your_layout.options(axiswise=False) +Similarly, if you have a HoloMap composed of multiple frames in an +animation or controlled with widgets, you can make each frame be normalized +independently by changing `framewise` to True: + +..code:: python + your_holomap.options(framewise=True) + + +**Q: Why doesn't my DynamicMap respect the `framewise` option for +axis normalization across frames?** + +**A:** Unfortunately, HoloViews has no way of knowing the axis ranges +of objects that might be returned by future calls to a DynamicMap's +callback function, and so there is no way for it to implement +`axiswise=False` normalization (even though such normalization +is otherwise normally the default in HoloViews). Thus as a special +case, a DynamicMap (whether created specifically or as the return +value of various operations that accept a `dynamic=True` argument) +always acts as if `axiswise=True` has been set on it. If you want +to normalize across all frames of a DynamicMap, you will need to manually +determine the appropriate axis range yourself and set that, e.g. with +``.redim.range()`` as described above. -If these options do not work, chances are, you have a DynamicMap, and so -you have to utilize the ``.redim.range()`` method aforementioned to manually -set the axes limits. **Q: The default figure size is so tiny! How do I enlarge it?** From d5d81b6275199adba1232c2952053c71fc4a9190 Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 08:20:24 -0500 Subject: [PATCH 3/8] Fixed syntax --- doc/FAQ.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 156f68184a..e956258f8b 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -58,14 +58,14 @@ be normalized together in your layout, you can change the `axiswise` normalization option to True, making each object be normalized independently: -..code:: python +.. code:: python your_layout.options(axiswise=True) Similarly, if you have a HoloMap composed of multiple frames in an animation or controlled with widgets, you can make each frame be normalized independently by changing `framewise` to True: -..code:: python +.. code:: python your_holomap.options(framewise=True) From 0857d1cb1efae829f02c1375628c6fd101330a85 Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 08:21:10 -0500 Subject: [PATCH 4/8] Fixed syntax --- doc/FAQ.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index e956258f8b..780164994f 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -59,6 +59,7 @@ normalization option to True, making each object be normalized independently: .. code:: python + your_layout.options(axiswise=True) Similarly, if you have a HoloMap composed of multiple frames in an @@ -66,6 +67,7 @@ animation or controlled with widgets, you can make each frame be normalized independently by changing `framewise` to True: .. code:: python + your_holomap.options(framewise=True) From 10d1b3139b4f27a96e85fce0484c1bec63f7c58f Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 08:22:05 -0500 Subject: [PATCH 5/8] FIxed syntax --- doc/FAQ.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 780164994f..a68ca37249 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -54,7 +54,7 @@ across frames in a HoloMap or objects in a Layout?** **A:** Where feasible, HoloViews defaults to normalizing axis ranges across all objects that are presented together, so that they can be compared directly. If you don't want objects that share a dimension to -be normalized together in your layout, you can change the `axiswise` +be normalized together in your layout, you can change the ``axiswise`` normalization option to True, making each object be normalized independently: @@ -64,7 +64,7 @@ independently: Similarly, if you have a HoloMap composed of multiple frames in an animation or controlled with widgets, you can make each frame be normalized -independently by changing `framewise` to True: +independently by changing ``framewise`` to True: .. code:: python From ea423e4146f4c1d8230d4a6115303b9d7ac71eca Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 08:23:49 -0500 Subject: [PATCH 6/8] Fixed syntax I hate rST. --- doc/FAQ.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index a68ca37249..d074df63e5 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -71,17 +71,17 @@ independently by changing ``framewise`` to True: your_holomap.options(framewise=True) -**Q: Why doesn't my DynamicMap respect the `framewise` option for +**Q: Why doesn't my DynamicMap respect the ``framewise`` option for axis normalization across frames?** **A:** Unfortunately, HoloViews has no way of knowing the axis ranges of objects that might be returned by future calls to a DynamicMap's callback function, and so there is no way for it to implement -`axiswise=False` normalization (even though such normalization +``axiswise=False`` normalization (even though such normalization is otherwise normally the default in HoloViews). Thus as a special case, a DynamicMap (whether created specifically or as the return -value of various operations that accept a `dynamic=True` argument) -always acts as if `axiswise=True` has been set on it. If you want +value of various operations that accept a ``dynamic=True`` argument) +always acts as if ``axiswise=True`` has been set on it. If you want to normalize across all frames of a DynamicMap, you will need to manually determine the appropriate axis range yourself and set that, e.g. with ``.redim.range()`` as described above. From 0fde02bb480c46d9b4c57a3afbf11391df526ee1 Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Mon, 1 Oct 2018 13:53:37 -0500 Subject: [PATCH 7/8] Partial fix --- doc/FAQ.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index d074df63e5..752e1c8a9a 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -77,11 +77,11 @@ axis normalization across frames?** **A:** Unfortunately, HoloViews has no way of knowing the axis ranges of objects that might be returned by future calls to a DynamicMap's callback function, and so there is no way for it to implement -``axiswise=False`` normalization (even though such normalization +``framewise=False`` normalization (even though such normalization is otherwise normally the default in HoloViews). Thus as a special case, a DynamicMap (whether created specifically or as the return value of various operations that accept a ``dynamic=True`` argument) -always acts as if ``axiswise=True`` has been set on it. If you want +always acts as if ``framewise=True`` has been set on it. If you want to normalize across all frames of a DynamicMap, you will need to manually determine the appropriate axis range yourself and set that, e.g. with ``.redim.range()`` as described above. From 27c5d8358513622ecea707498ec473cf82c8631e Mon Sep 17 00:00:00 2001 From: "James A. Bednar" Date: Tue, 2 Oct 2018 08:28:08 -0500 Subject: [PATCH 8/8] Clarified framewise=False behavior --- doc/FAQ.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/FAQ.rst b/doc/FAQ.rst index 752e1c8a9a..2701a19e49 100644 --- a/doc/FAQ.rst +++ b/doc/FAQ.rst @@ -71,18 +71,19 @@ independently by changing ``framewise`` to True: your_holomap.options(framewise=True) -**Q: Why doesn't my DynamicMap respect the ``framewise`` option for +**Q: Why doesn't my DynamicMap respect the framewise=False option for axis normalization across frames?** **A:** Unfortunately, HoloViews has no way of knowing the axis ranges of objects that might be returned by future calls to a DynamicMap's -callback function, and so there is no way for it to implement +callback function, and so there is no way for it to fully implement ``framewise=False`` normalization (even though such normalization -is otherwise normally the default in HoloViews). Thus as a special -case, a DynamicMap (whether created specifically or as the return -value of various operations that accept a ``dynamic=True`` argument) -always acts as if ``framewise=True`` has been set on it. If you want -to normalize across all frames of a DynamicMap, you will need to manually +is the default in HoloViews). Thus as a special case, a DynamicMap +(whether created specifically or as the return value of various +operations that accept a ``dynamic=True`` argument) will by default +compute its ranges *using the first frame's data only*. If that is not +the behavior you want, you either set ``framewise=True`` on it to enable +normalization on every frame independently, or you can manually determine the appropriate axis range yourself and set that, e.g. with ``.redim.range()`` as described above.