Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
67d94584
Commit
67d94584
authored
Sep 08, 2021
by
Zhang, Chen
Browse files
use numpy loadtxt func instead
parent
f60ce9a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
qt/python/mantidqt/widgets/colorbar/colorbar.py
View file @
67d94584
...
...
@@ -32,9 +32,7 @@ def register_customized_colormaps():
cmap_files
=
glob
.
glob
(
os
.
path
.
join
(
cmap_path
,
"*.map"
))
for
cmap_file
in
cmap_files
:
cmap_name
=
os
.
path
.
basename
(
cmap_file
).
split
(
"."
)[
0
]
with
open
(
cmap_file
,
"r"
)
as
f
:
cmap_data
=
np
.
array
([
list
(
map
(
float
,
line
.
split
()))
for
line
in
f
.
readlines
()])
/
255.0
#
cmap_data
=
np
.
loadtxt
(
cmap_file
)
/
255.0
cmap
=
ListedColormap
(
cmap_data
,
name
=
cmap_name
)
cm
.
register_cmap
(
name
=
cmap_name
,
cmap
=
cmap
)
...
...
Write
Preview
Markdown
is supported
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