def thetagrids(*args, **kwargs):
ax = gca()<EOL>if not isinstance(ax, PolarAxes):<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if len(args)==<NUM_LIT:0>:<EOL><INDENT>lines = ax.xaxis.get_ticklines()<EOL>labels = ax.xaxis.get_ticklabels()<EOL><DEDENT>else:<EOL><INDENT>lines, labels = ax.set_thetagrids(*args, **kwargs)<EOL><DEDENT>draw_if_interactive()<EOL>return (silent_list('<STR_LIT>', lines),<EOL>silent_list('<STR_LIT>', labels)<EOL>)<EOL>
Set/Get the theta locations of the gridlines and ticklabels.

If no arguments are passed, return a tuple (*lines*, *labels*)
where *lines* is an array of radial gridlines
(:class:`~matplotlib.lines.Line2D` instances) and *labels* is an
array of tick labels (:class:`~matplotlib.text.Text` instances)::

  lines, labels = thetagrids()

Otherwise the syntax is::

  lines, labels = thetagrids(angles, labels=None, fmt='%d', frac = 1.1)

set the angles at which to place the theta grids (these gridlines
are equal along the theta dimension).

*angles* is in degrees.

*labels*, if not *None*, is a len(angles) list of strings of the
labels to use at each angle.

If *labels* is *None*, the labels will be ``fmt%angle``.

*frac* is the fraction of the polar axes radius at which to place
the label (1 is the edge). Eg. 1.05 is outside the axes and 0.95
is inside the axes.

Return value is a list of tuples (*lines*, *labels*):

  - *lines* are :class:`~matplotlib.lines.Line2D` instances

  - *labels* are :class:`~matplotlib.text.Text` instances.

Note that on input, the *labels* argument is a list of strings,
and on output it is a list of :class:`~matplotlib.text.Text`
instances.

Examples::

  # set the locations of the radial gridlines and labels
  lines, labels = thetagrids( range(45,360,90) )

  # set the locations and labels of the radial gridlines and labels
  lines, labels = thetagrids( range(45,360,90), ('NE', 'NW', 'SW','SE') )