Get or set the theta gridlines on the current polar plot. Call signatures:: lines, labels = thetagrids() lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs) When called with no arguments, `.thetagrids` simply returns the tuple (*lines*, *labels*). When c
(*args, **kwargs)
| 1706 | |
| 1707 | |
| 1708 | def thetagrids(*args, **kwargs): |
| 1709 | """ |
| 1710 | Get or set the theta gridlines on the current polar plot. |
| 1711 | |
| 1712 | Call signatures:: |
| 1713 | |
| 1714 | lines, labels = thetagrids() |
| 1715 | lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs) |
| 1716 | |
| 1717 | When called with no arguments, `.thetagrids` simply returns the tuple |
| 1718 | (*lines*, *labels*). When called with arguments, the labels will |
| 1719 | appear at the specified angles. |
| 1720 | |
| 1721 | Parameters |
| 1722 | ---------- |
| 1723 | angles : tuple with floats, degrees |
| 1724 | The angles of the theta gridlines. |
| 1725 | |
| 1726 | labels : tuple with strings or None |
| 1727 | The labels to use at each radial gridline. The |
| 1728 | `.projections.polar.ThetaFormatter` will be used if None. |
| 1729 | |
| 1730 | fmt : str or None |
| 1731 | Format string used in `matplotlib.ticker.FormatStrFormatter`. |
| 1732 | For example '%f'. Note that the angle in radians will be used. |
| 1733 | |
| 1734 | Returns |
| 1735 | ------- |
| 1736 | lines, labels : list of `.lines.Line2D`, list of `.text.Text` |
| 1737 | *lines* are the theta gridlines and *labels* are the tick labels. |
| 1738 | |
| 1739 | Other Parameters |
| 1740 | ---------------- |
| 1741 | **kwargs |
| 1742 | *kwargs* are optional `~.Text` properties for the labels. |
| 1743 | |
| 1744 | Examples |
| 1745 | -------- |
| 1746 | :: |
| 1747 | |
| 1748 | # set the locations of the angular gridlines |
| 1749 | lines, labels = thetagrids( range(45,360,90) ) |
| 1750 | |
| 1751 | # set the locations and labels of the angular gridlines |
| 1752 | lines, labels = thetagrids( range(45,360,90), ('NE', 'NW', 'SW','SE') ) |
| 1753 | |
| 1754 | See Also |
| 1755 | -------- |
| 1756 | .pyplot.rgrids |
| 1757 | .projections.polar.PolarAxes.set_thetagrids |
| 1758 | .Axis.get_gridlines |
| 1759 | .Axis.get_ticklabels |
| 1760 | """ |
| 1761 | ax = gca() |
| 1762 | if not isinstance(ax, PolarAxes): |
| 1763 | raise RuntimeError('thetagrids only defined for polar axes') |
| 1764 | if len(args)==0: |
| 1765 | lines = ax.xaxis.get_ticklines() |
nothing calls this directly
no test coverage detected