[ 
https://issues.apache.org/jira/browse/CLIMATE-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020465#comment-14020465
 ] 

ASF GitHub Bot commented on CLIMATE-466:
----------------------------------------

Github user agoodm commented on a diff in the pull request:

    https://github.com/apache/climate/pull/67#discussion_r13513738
  
    --- Diff: ocw/plotter.py ---
    @@ -61,8 +61,19 @@ def _nice_intervals(data, nlevs):
         # Find the min and max levels by cutting off the tails of the 
distribution
         # This mitigates the influence of outliers
         data = data.ravel()
    -    mnlvl = mstats.scoreatpercentile(data, 5)
    -    mxlvl = mstats.scoreatpercentile(data, 95)
    +    mn = mstats.scoreatpercentile(data, 5)
    +    mx = mstats.scoreatpercentile(data, 95)
    +    #if there min less than 0 then
    +    #put 0 in center of color bar
    +    if mn < 0:
    --- End diff --
    
    This line should be changed to
    ```python
    if mn < 0 and mx > 0:
    ```
    because otherwise you will end up centering the contours at 0 when the 
maximum value is negative. This results in superfluous contour levels.


> Plotter need better configuration for generating color bar
> ----------------------------------------------------------
>
>                 Key: CLIMATE-466
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-466
>             Project: Apache Open Climate Workbench
>          Issue Type: Improvement
>          Components: visualization
>    Affects Versions: 0.3-incubating
>            Reporter: Maziyar Boustani
>            Assignee: Maziyar Boustani
>             Fix For: 0.4
>
>
> In plotter.py function "_nice_intervals" need to understand the range of 
> values in different cases and be able to make a correct color bar for plot.
> If the values all are above 0 then make color bar starts from min to max.
> But if the values are between negative and positive then always keep 0 in 
> center of color bar.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to