Skip to content

Commit

Permalink
FIX : handle color better it qt editor
Browse files Browse the repository at this point in the history
Convert all line colors to hex before passing into the form layout.
  • Loading branch information
tacaswell committed May 6, 2015
1 parent 66a8ac0 commit aa56ae9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/matplotlib/backends/qt_editor/figureoptions.py
Expand Up @@ -17,6 +17,7 @@
import matplotlib.backends.qt_editor.formlayout as formlayout
from matplotlib.backends.qt_compat import QtGui
from matplotlib import markers
from matplotlib.colors import colorConverter, rgb2hex


def get_icon(name):
Expand Down Expand Up @@ -73,18 +74,21 @@ def figure_edit(axes, parent=None):
curvelabels = sorted(linedict.keys())
for label in curvelabels:
line = linedict[label]
color = rgb2hex(colorConverter.to_rgb(line.get_color()))
ec = rgb2hex(colorConverter.to_rgb(line.get_markeredgecolor()))
fc = rgb2hex(colorConverter.to_rgb(line.get_markerfacecolor()))
curvedata = [('Label', label),
sep,
(None, '<b>Line</b>'),
('Style', [line.get_linestyle()] + linestyles),
('Width', line.get_linewidth()),
('Color', line.get_color()),
('Color', color),
sep,
(None, '<b>Marker</b>'),
('Style', [line.get_marker()] + markers),
('Size', line.get_markersize()),
('Facecolor', line.get_markerfacecolor()),
('Edgecolor', line.get_markeredgecolor()),
('Facecolor', fc),
('Edgecolor', ec),
]
curves.append([curvedata, label, ""])
# make sure that there is at least one displayed curve
Expand Down

0 comments on commit aa56ae9

Please sign in to comment.