Commit 33227e94 authored by Daniel Boeckenhoff's avatar Daniel Boeckenhoff
Browse files

plotting init bugfix

parent d5d97e5f
......@@ -111,7 +111,7 @@ class PlotOptions(object):
vmin = min(scalars)
self.plotKwargs['vmin'] = vmin
if vmax is None:
vmax = min(scalars)
vmax = max(scalars)
self.plotKwargs['vmax'] = vmax
def getNormArgs(self, vminDefault=0, vmaxDefault=1, cmapDefault=None):
......@@ -128,8 +128,8 @@ class PlotOptions(object):
Args:
colors (list/one value of rgba tuples/int/float/str): This argument will
be interpreted as color
fmt (str): rgba / norm
length (int/None): if not None: corrct colors lenght
fmt (str): rgba | hex | norm
length (int/None): if not None: correct colors lenght
Returns:
colors in fmt
......@@ -165,6 +165,11 @@ class PlotOptions(object):
vmin=vmin,
vmax=vmax,
cmap=cmap)
elif fmt == 'hex':
colors = [mpl.colors.to_hex(color) for color in colors]
else:
raise NotImplementedError("Color fmt {fmt} not implemented."
.format(**locals()))
if length is not None:
# just one colors value given
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment