Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
6ed2dc81
Commit
6ed2dc81
authored
6 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Decay to Jet cmap if Viridis is not available
Older versions of matplotlib don't ship with Viridis...
parent
c82a2330
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/applications/workbench/workbench/plotting/functions.py
+5
-2
5 additions, 2 deletions
qt/applications/workbench/workbench/plotting/functions.py
with
5 additions
and
2 deletions
qt/applications/workbench/workbench/plotting/functions.py
+
5
−
2
View file @
6ed2dc81
...
@@ -26,6 +26,10 @@ import math
...
@@ -26,6 +26,10 @@ import math
from
mantid.api
import
AnalysisDataService
,
MatrixWorkspace
from
mantid.api
import
AnalysisDataService
,
MatrixWorkspace
from
mantid.kernel
import
Logger
from
mantid.kernel
import
Logger
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
try
:
from
matplotlib.cm
import
viridis
as
DEFAULT_CMAP
except
ImportError
:
from
matplotlib.cm
import
jet
as
DEFAULT_CMAP
from
mantidqt.py3compat
import
is_text_string
from
mantidqt.py3compat
import
is_text_string
from
mantidqt.dialogs.spectraselectordialog
import
get_spectra_selection
from
mantidqt.dialogs.spectraselectordialog
import
get_spectra_selection
from
matplotlib.gridspec
import
GridSpec
from
matplotlib.gridspec
import
GridSpec
...
@@ -38,7 +42,6 @@ from .figuretype import figure_type, FigureType
...
@@ -38,7 +42,6 @@ from .figuretype import figure_type, FigureType
# Constants
# Constants
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
PROJECTION
=
'
mantid
'
PROJECTION
=
'
mantid
'
DEFAULT_COLORMAP
=
'
viridis
'
# See https://matplotlib.org/api/_as_gen/matplotlib.figure.SubplotParams.html#matplotlib.figure.SubplotParams
# See https://matplotlib.org/api/_as_gen/matplotlib.figure.SubplotParams.html#matplotlib.figure.SubplotParams
SUBPLOT_WSPACE
=
0.5
SUBPLOT_WSPACE
=
0.5
SUBPLOT_HSPACE
=
0.5
SUBPLOT_HSPACE
=
0.5
...
@@ -217,7 +220,7 @@ def pcolormesh(workspaces, fig=None):
...
@@ -217,7 +220,7 @@ def pcolormesh(workspaces, fig=None):
if
subplot_idx
<
workspaces_len
:
if
subplot_idx
<
workspaces_len
:
ws
=
workspaces
[
subplot_idx
]
ws
=
workspaces
[
subplot_idx
]
ax
.
set_title
(
ws
.
name
())
ax
.
set_title
(
ws
.
name
())
pcm
=
ax
.
pcolormesh
(
ws
,
cmap
=
DEFAULT_C
OLOR
MAP
)
pcm
=
ax
.
pcolormesh
(
ws
,
cmap
=
DEFAULT_CMAP
)
for
lbl
in
ax
.
get_xticklabels
():
for
lbl
in
ax
.
get_xticklabels
():
lbl
.
set_rotation
(
45
)
lbl
.
set_rotation
(
45
)
if
col_idx
<
ncols
-
1
:
if
col_idx
<
ncols
-
1
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment