Skip to content

Commit 3023ecc

Browse files
committed
Add comment
1 parent 903e3f3 commit 3023ecc

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

python/paddle/utils/plot.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ def reset(self):
3030

3131

3232
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+
3342
def __init__(self, *args):
3443
self.__args__ = args
3544
self.__plot_data__ = {}
@@ -50,13 +59,37 @@ def __plot_is_disabled__(self):
5059
return self.__disable_plot__ == "True"
5160

5261
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+
'''
5375
assert isinstance(title, basestring)
5476
assert self.__plot_data__.has_key(title)
5577
data = self.__plot_data__[title]
5678
assert isinstance(data, PlotData)
5779
data.append(step, value)
5880

5981
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+
'''
6093
if self.__plot_is_disabled__():
6194
return
6295

0 commit comments

Comments
 (0)