MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_thetagrids

Method set_thetagrids

lib/matplotlib/projections/polar.py:1257–1316  ·  view source on GitHub ↗

Set the theta gridlines in a polar plot. Parameters ---------- angles : tuple with floats, degrees The angles of the theta gridlines. labels : tuple with strings or None The labels to use at each theta gridline. The `.pro

(self, angles, labels=None, fmt=None, **kwargs)

Source from the content-addressed store, hash-verified

1255 return Axes.set_yticks(self, *args, **kwargs)
1256
1257 def set_thetagrids(self, angles, labels=None, fmt=None, **kwargs):
1258 """
1259 Set the theta gridlines in a polar plot.
1260
1261 Parameters
1262 ----------
1263 angles : tuple with floats, degrees
1264 The angles of the theta gridlines.
1265
1266 labels : tuple with strings or None
1267 The labels to use at each theta gridline. The
1268 `.projections.polar.ThetaFormatter` will be used if None.
1269
1270 fmt : str or None
1271 Format string used in `matplotlib.ticker.FormatStrFormatter`.
1272 For example '%f'. Note that the angle that is used is in
1273 radians.
1274
1275 Returns
1276 -------
1277 lines : list of `.lines.Line2D`
1278 The theta gridlines.
1279
1280 labels : list of `.text.Text`
1281 The tick labels.
1282
1283 Other Parameters
1284 ----------------
1285 **kwargs
1286 *kwargs* are optional `.Text` properties for the labels.
1287
1288 .. warning::
1289
1290 This only sets the properties of the current ticks.
1291 Ticks are not guaranteed to be persistent. Various operations
1292 can create, delete and modify the Tick instances. There is an
1293 imminent risk that these settings can get lost if you work on
1294 the figure further (including also panning/zooming on a
1295 displayed figure).
1296
1297 Use `.set_tick_params` instead if possible.
1298
1299 See Also
1300 --------
1301 .PolarAxes.set_rgrids
1302 .Axis.get_gridlines
1303 .Axis.get_ticklabels
1304 """
1305
1306 # Make sure we take into account unitized data
1307 angles = self.convert_yunits(angles)
1308 angles = np.deg2rad(angles)
1309 self.set_xticks(angles)
1310 if labels is not None:
1311 self.set_xticklabels(labels)
1312 elif fmt is not None:
1313 self.xaxis.set_major_formatter(mticker.FormatStrFormatter(fmt))
1314 for t in self.xaxis.get_ticklabels():

Callers 3

thetagridsFunction · 0.80
test_polar_alignmentFunction · 0.80
set_varlabelsMethod · 0.80

Calls 6

convert_yunitsMethod · 0.80
set_xticksMethod · 0.80
get_ticklabelsMethod · 0.80
_internal_updateMethod · 0.80
get_ticklinesMethod · 0.80
set_major_formatterMethod · 0.45

Tested by 1

test_polar_alignmentFunction · 0.64