为了让我们的日K图更加易于比较,我们可以为它添加网格,用到的函数如下:
def grid(self, visible=None, which='major', **kwargs):
"""
Configure the grid lines.
Parameters
----------
visible : bool or None
Whether to show the grid lines. If any *kwargs* are supplied, it
is assumed you want the grid on and *visible* will be set to True.
If *visible* is *None* and there are no *kwargs*, this toggles the
visibility of the lines.
which : {'major', 'minor', 'both'}
The grid lines to apply the changes on.
**kwargs : `.Line2D` properties
Define the line properties of the grid, e.g.::
grid(color='r', linestyle='-', linewidth=2)
"""
if kwargs:
if visible is None:
visible = T