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

Skip to content

Commit 85b5e28

Browse files
committed
Update Gtk and Qt4 backends to be aware of the new location of the marker definitions.
1 parent b93fc8f commit 85b5e28

2 files changed

Lines changed: 4 additions & 25 deletions

File tree

lib/matplotlib/backends/backend_gtk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def fn_name(): return sys._getframe(1).f_code.co_name
3232
from matplotlib.widgets import SubplotTool
3333

3434
from matplotlib import lines
35+
from matplotlib import markers
3536
from matplotlib import cbook
3637
from matplotlib import verbose
3738

@@ -1076,7 +1077,7 @@ class DialogLineprops:
10761077
linestyled = dict([ (s,i) for i,s in enumerate(linestyles)])
10771078

10781079

1079-
markers = [m for m in lines.Line2D.markers if cbook.is_string_like(m)]
1080+
markers = [m for m in markers.MarkerStyle.markers if cbook.is_string_like(m)]
10801081

10811082
markerd = dict([(s,i) for i,s in enumerate(markers)])
10821083

lib/matplotlib/backends/qt4_editor/figureoptions.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import matplotlib.backends.qt4_editor.formlayout as formlayout
1212
from matplotlib.backends.qt4_compat import QtGui
13+
from matplotlib import markers
1314

1415
def get_icon(name):
1516
import matplotlib
@@ -25,30 +26,7 @@ def get_icon(name):
2526
'none': 'None',
2627
}
2728

28-
MARKERS = {
29-
'none': 'None',
30-
'o': 'circles',
31-
'^': 'triangle_up',
32-
'v': 'triangle_down',
33-
'<': 'triangle_left',
34-
'>': 'triangle_right',
35-
's': 'square',
36-
'+': 'plus',
37-
'x': 'cross',
38-
'*': 'star',
39-
'D': 'diamond',
40-
'd': 'thin_diamond',
41-
'1': 'tripod_down',
42-
'2': 'tripod_up',
43-
'3': 'tripod_left',
44-
'4': 'tripod_right',
45-
'h': 'hexagon',
46-
'H': 'rotated_hexagon',
47-
'p': 'pentagon',
48-
'|': 'vertical_line',
49-
'_': 'horizontal_line',
50-
'.': 'dots',
51-
}
29+
MARKERS = markers.MarkerStyle.markers
5230

5331
COLORS = {'b': '#0000ff', 'g': '#00ff00', 'r': '#ff0000', 'c': '#ff00ff',
5432
'm': '#ff00ff', 'y': '#ffff00', 'k': '#000000', 'w': '#ffffff'}

0 commit comments

Comments
 (0)