Skip to content

Commit daf7efb

Browse files
committed
Merge pull request matplotlib#2275 from mspacek/edit_color
Fix Qt4 figure editor color setting and getting
2 parents 7e64adf + 00aae5f commit daf7efb

File tree

2 files changed

+109
-147
lines changed

2 files changed

+109
-147
lines changed

lib/matplotlib/backends/qt4_editor/figureoptions.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ def get_icon(name):
3030

3131
MARKERS = markers.MarkerStyle.markers
3232

33-
COLORS = {'b': '#0000ff', 'g': '#00ff00', 'r': '#ff0000', 'c': '#ff00ff',
34-
'm': '#ff00ff', 'y': '#ffff00', 'k': '#000000', 'w': '#ffffff'}
35-
36-
def col2hex(color):
37-
"""Convert matplotlib color to hex"""
38-
return COLORS.get(color, color)
39-
4033
def figure_edit(axes, parent=None):
4134
"""Edit matplotlib figure options"""
4235
sep = (None, None) # separator
@@ -79,13 +72,13 @@ def figure_edit(axes, parent=None):
7972
(None, '<b>Line</b>'),
8073
('Style', [line.get_linestyle()] + linestyles),
8174
('Width', line.get_linewidth()),
82-
('Color', col2hex(line.get_color())),
75+
('Color', line.get_color()),
8376
sep,
8477
(None, '<b>Marker</b>'),
8578
('Style', [line.get_marker()] + markers),
8679
('Size', line.get_markersize()),
87-
('Facecolor', col2hex(line.get_markerfacecolor())),
88-
('Edgecolor', col2hex(line.get_markeredgecolor())),
80+
('Facecolor', line.get_markerfacecolor()),
81+
('Edgecolor', line.get_markeredgecolor()),
8982
]
9083
curves.append([curvedata, label, ""])
9184

0 commit comments

Comments
 (0)