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
8bf13bc0
Prev
Next
Show latest version
1 file
+
7
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8bf13bc0
fixed issue with uneven white spacing due to the colorbar
· 8bf13bc0
David Johansen
authored
8 months ago
qim3d/viz/explore.py
+
7
−
1
View file @ 8bf13bc0
Edit in single-file editor
Open in Web IDE
Show full file
@@ -192,9 +192,15 @@ def slices(
ax
.
axis
(
"
off
"
)
if
cbar
:
fig
.
tight_layout
()
norm
=
matplotlib
.
colors
.
Normalize
(
vmin
=
new_vmin
,
vmax
=
new_vmax
,
clip
=
True
)
mappable
=
matplotlib
.
cm
.
ScalarMappable
(
norm
=
norm
,
cmap
=
cmap
)
fig
.
colorbar
(
mappable
=
mappable
,
ax
=
np
.
atleast_1d
(
axs
[
0
])[
-
1
],
orientation
=
'
vertical
'
)
# Figure coordinates of top-right axis
tr_pos
=
np
.
atleast_1d
(
axs
[
0
])[
-
1
].
get_position
()
# The width is divided by ncols to make it the same relative size to the images
cbar_ax
=
fig
.
add_axes
([
tr_pos
.
x1
+
0.05
/
ncols
,
tr_pos
.
y0
,
0.05
/
ncols
,
tr_pos
.
height
])
fig
.
colorbar
(
mappable
=
mappable
,
cax
=
cbar_ax
,
orientation
=
'
vertical
'
)
if
show
:
plt
.
show
()
Loading