Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qim3d
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QIM
Tools
qim3d
Merge requests
!124
Viz add colorbar
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Viz add colorbar
viz-add-colorbar
into
main
Overview
0
Commits
6
Pipelines
0
Changes
1
Merged
s214743
requested to merge
viz-add-colorbar
into
main
8 months ago
Overview
0
Commits
6
Pipelines
0
Changes
1
https://www.notion.so/qim-dtu/Add-colorbar-to-vizualisation-tools-a1b4cb67bd4a4de39a7ac40bf5d35fd5
0
0
Merge request reports
Viewing commit
0dd13871
Prev
Next
Show latest version
1 file
+
7
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
0dd13871
supressing warning
· 0dd13871
fima
authored
8 months ago
qim3d/viz/explore.py
+
7
−
2
View file @ 0dd13871
Edit in single-file editor
Open in Web IDE
Show full file
@@ -3,6 +3,8 @@ Provides a collection of visualization functions.
"""
import
math
import
warnings
from
typing
import
List
,
Optional
,
Union
import
dask.array
as
da
@@ -130,6 +132,7 @@ def slices(
figsize
=
(
ncols
*
img_height
,
nrows
*
img_width
),
constrained_layout
=
True
,
)
if
nrows
==
1
:
axs
=
[
axs
]
# Convert to a list for uniformity
@@ -191,8 +194,10 @@ def slices(
# Hide the axis, so that we have a nice grid
ax
.
axis
(
"
off
"
)
if
cbar
:
fig
.
tight_layout
()
if
cbar
:
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
"
ignore
"
,
category
=
UserWarning
)
fig
.
tight_layout
()
norm
=
matplotlib
.
colors
.
Normalize
(
vmin
=
new_vmin
,
vmax
=
new_vmax
,
clip
=
True
)
mappable
=
matplotlib
.
cm
.
ScalarMappable
(
norm
=
norm
,
cmap
=
cmap
)
Loading