Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2639ad3

Browse files
authored
Merge pull request #11208 from anntzer/dont-crash-figure-options-on-unknown-style
Don't crash qt figure options on unknown marker styles.
2 parents ac28fee + 0dc4e43 commit 2639ad3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def prepare_data(d, init):
9393
FormLayout combobox, namely `[initial_name, (shorthand,
9494
style_name), (shorthand, style_name), ...]`.
9595
"""
96+
if init not in d:
97+
d = {**d, init: str(init)}
9698
# Drop duplicate shorthands from dict (by overwriting them during
9799
# the dict comprehension).
98100
name2short = {name: short for short, name in d.items()}

0 commit comments

Comments
 (0)