@@ -30,6 +30,15 @@ def reset(self):
30
30
31
31
32
32
class Ploter (object ):
33
+ '''
34
+ Plot input data in a 2D graph
35
+
36
+ Args:
37
+ title: assign the title of input data.
38
+ step: x_axis of the data.
39
+ value: y_axis of the data
40
+ '''
41
+
33
42
def __init__ (self , * args ):
34
43
self .__args__ = args
35
44
self .__plot_data__ = {}
@@ -50,13 +59,37 @@ def __plot_is_disabled__(self):
50
59
return self .__disable_plot__ == "True"
51
60
52
61
def append (self , title , step , value ):
62
+ '''
63
+ Feed data
64
+
65
+ Args:
66
+ title: assign the group data to this subtitle.
67
+ step: the x_axis of data.
68
+ value: the y_axis of data.
69
+
70
+ Examples:
71
+ .. code-block:: python
72
+ plot_curve = Ploter("Curve 1","Curve 2")
73
+ plot_curve.append(title="Curve 1",step=1,value=1)
74
+ '''
53
75
assert isinstance (title , basestring )
54
76
assert self .__plot_data__ .has_key (title )
55
77
data = self .__plot_data__ [title ]
56
78
assert isinstance (data , PlotData )
57
79
data .append (step , value )
58
80
59
81
def plot (self , path = None ):
82
+ '''
83
+ Plot data in a 2D graph
84
+
85
+ Args:
86
+ path: store the figure to this file path. Defaul None.
87
+
88
+ Examples:
89
+ .. code-block:: python
90
+ plot_curve = Ploter()
91
+ plot_cure.plot()
92
+ '''
60
93
if self .__plot_is_disabled__ ():
61
94
return
62
95
0 commit comments