-
Notifications
You must be signed in to change notification settings - Fork 4
/
Scatter.py
56 lines (45 loc) · 1.45 KB
/
Scatter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from matplotlib import pyplot
from PlotInfo import *
from Marker import Marker
class Scatter(PlotInfo):
def __init__(self,
marker='o',
markerSize=20,
color="black", **kwargs):
super(Scatter,self).__init__("scatter", **kwargs)
self._marker = Marker()
self._marker.marker = marker
self._marker.size = markerSize
self.color = color
"""
The color of points in the scatter plot. See :ref:`styling-colors` for
valid colors.
"""
@property
def marker(self):
"""
The marker type used to mark points in the scatter plot. See
:ref:`styling-markers` for valid marker types.
"""
return self._marker.marker
@marker.setter
def marker(self, value):
self._marker.marker = value
@property
def markerSize(self):
"""
The size of the scatter plot's markers.
"""
return self._marker.size
@markerSize.setter
def markerSize(self, value):
self._marker.size = value
def draw(self, fig, axis, transform = None):
super(Scatter, self).draw(fig, axis)
kwdict = self.getAttributes()
kwdict["marker"] = self.marker
kwdict["label"] = self.label
kwdict["color"] = self.color
kwdict["s"] = self.markerSize
return [[axis.scatter(self.xValues, self.yValues, **kwdict)],
[self.label]]