psyplot / psy-simple

psy-simple: The psyplot plugin for simple visualizations
https://psyplot.github.io/psy-simple
1 stars 3 forks source link

plot2d fails to calculate color levels when array has only one single value #8

Closed Chilipp closed 4 years ago

Chilipp commented 4 years ago

Code Sample, a copy-pastable example if possible

import numpy as np                                                                                                                                                                                        
import psyplot.project as psy                                                                                                                                                                             
import xarray as xr                                                                                                                                                                                       
ds = xr.Dataset()                                                                                                                                                                                         
ds['test'] = (('y', 'x'), np.ones((4, 5)))                                                                                                                                                                
ds.psy.plot.plot2d()   

Problem description

This command fails because the color levels cannot be calculated correctly.

Expected Output

It should draw the plot with one single color.