Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Boeckenhoff
tfields
Commits
33227e94
Commit
33227e94
authored
Dec 21, 2018
by
Daniel Boeckenhoff
Browse files
plotting init bugfix
parent
d5d97e5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tfields/plotting/__init__.py
View file @
33227e94
...
...
@@ -111,7 +111,7 @@ class PlotOptions(object):
vmin
=
min
(
scalars
)
self
.
plotKwargs
[
'vmin'
]
=
vmin
if
vmax
is
None
:
vmax
=
m
in
(
scalars
)
vmax
=
m
ax
(
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: corr
e
ct 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment