Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 21174b5

Browse filesBrowse files
committed
Allow setting image clims in Qt options editor.
Currently, `(cmin, cmax)` is swapped if `cmin > cmax` because it's not easy to impose the constraint using formlayout.
1 parent cf4b219 commit 21174b5
Copy full SHA for 21174b5

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎lib/matplotlib/backends/qt_editor/figureoptions.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/qt_editor/figureoptions.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ def prepare_data(d, init):
139139
cmap = image.get_cmap()
140140
if cmap not in cm.cmap_d.values():
141141
cmaps = [(cmap, cmap.name)] + cmaps
142+
low, high = image.get_clim()
142143
imagedata = [
143144
('Label', label),
144-
('Colormap', [cmap.name] + cmaps)
145-
]
145+
('Colormap', [cmap.name] + cmaps),
146+
('Min. value', low),
147+
('Max. value', high)]
146148
images.append([imagedata, label, ""])
147149
# Is there an image displayed?
148150
has_image = bool(images)
@@ -203,9 +205,10 @@ def apply_callback(data):
203205
# Set / Images
204206
for index, image_settings in enumerate(images):
205207
image = imagedict[imagelabels[index]]
206-
label, cmap = image_settings
208+
label, cmap, low, high = image_settings
207209
image.set_label(label)
208210
image.set_cmap(cm.get_cmap(cmap))
211+
image.set_clim(*sorted([low, high]))
209212

210213
# re-generate legend, if checkbox is checked
211214
if generate_legend:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.