8000 Merge pull request #4589 from mfitzp/figureoptions-linestyle-step · matplotlib/matplotlib@9410ddb · GitHub
[go: up one dir, main page]

Skip to content

Commit 9410ddb

Browse files
committed
Merge pull request #4589 from mfitzp/figureoptions-linestyle-step
FIX: Add separate drawstyles options to Qt figureoptions dialog
2 parents 4505791 + 9764da1 commit 9410ddb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ def get_icon(name):
2929
'--': 'Dashed',
3030
'-.': 'DashDot',
3131
':': 'Dotted',
32-
'steps': 'Steps',
3332
'none': 'None',
3433
}
3534

35+
DRAWSTYLES = {'default': 'Default',
36+
'steps': 'Steps',
37+
}
38+
3639
MARKERS = markers.MarkerStyle.markers
3740

3841

@@ -70,6 +73,7 @@ def figure_edit(axes, parent=None):
7073
linedict[label] = line
7174
curves = []
7275
linestyles = list(six.iteritems(LINESTYLES))
76+
drawstyles = list(six.iteritems(DRAWSTYLES))
7377
markers = list(six.iteritems(MARKERS))
7478
curvelabels = sorted(linedict.keys())
7579
for label in curvelabels:
@@ -80,7 +84,8 @@ def figure_edit(axes, parent=None):
8084
curvedata = [('Label', label),
8185
sep,
8286
(None, '<b>Line</b>'),
83-
('Style', [line.get_linestyle()] + linestyles),
87+
('Line Style', [line.get_linestyle()] + linestyles),
88+
('Draw Style', [line.get_drawstyle()] + drawstyles),
8489
('Width', line.get_linewidth()),
8590
('Color', color),
8691
sep,
@@ -91,8 +96,9 @@ def figure_edit(axes, parent=None):
9196
('Edgecolor', ec),
9297
]
9398
curves.append([curvedata, label, ""])
94-
# make sure that there is at least one displayed curve
95-
has_curve = bool(curves)
99+
100+
# make sure that there is at least one displayed curve
101+
has_curve = bool(curves)
96102

97103
datalist = [(general, "Axes", "")]
98104
if has_curve:
@@ -120,11 +126,12 @@ def apply_callback(data):
120126
# Set / Curves
121127
for index, curve in enumerate(curves):
122128
line = linedict[curvelabels[index]]
123-
label, linestyle, linewidth, color, \
129+
label, linestyle, drawstyle, linewidth, color, \
124130
marker, markersize, markerfacecolor, markeredgecolor \
125131
= curve
126132
line.set_label(label)
127133
line.set_linestyle(linestyle)
134+
line.set_drawstyle(drawstyle)
128135
line.set_linewidth(linewidth)
129136
line.set_color(color)
130137
if marker is not 'none':

0 commit comments

Comments
 (0)
0