|
293 | 293 | # |
294 | 294 | # .. image:: /_static/3d_scatter.png |
295 | 295 | # |
| 296 | +# Visualize a polar plot |
| 297 | +# -------------------------- |
| 298 | +# |
| 299 | +# A polar plot is a plot type that visualizes the data point in a polar |
| 300 | +# coordinate system. One common variation of a polar plot is a radar chart. The |
| 301 | +# data position is determined by: |
| 302 | + |
| 303 | +############################################################################### |
| 304 | +# * Radius (r): The distance from the center of the polar plot, defined by |
| 305 | +# the **yaxis** property. |
| 306 | +# * Theta (θ): The direction of the point, measured in numeric degrees or |
| 307 | +# categorical data, defined by the **xaxis** property. |
| 308 | + |
| 309 | +############################################################################### |
| 310 | +# .. note:: |
| 311 | +# * **Scatter polar** is the only available polar plot type for now. |
| 312 | +# * The **theta (θ)** value is defined by the data type of the **xaxis** |
| 313 | +# values: |
| 314 | +# |
| 315 | +# * If xaxis values have minus numeric value: The labels will be a list |
| 316 | +# of symmetrical values from "**(-180°) - (180°)**". |
| 317 | +# * If xaxis values are all positive values: The labeles will be from |
| 318 | +# "**(0°) - (360°)**". |
| 319 | +# * If xaxis values are categorical values: All xaxis values will be used |
| 320 | +# to label. |
| 321 | + |
| 322 | +polar = adr_service.create_item() |
| 323 | +# We can use the same data as we use to visualize heatmap |
| 324 | +polar.item_table = np.array( |
| 325 | + [ |
| 326 | + ["-180", "-135", "-90", "-45", "0", "45", "90", "135", "180"], |
| 327 | + [8.2, 7.3, 10.6, 5.6, 5.9, 9.1, 2.4, 1.6, 4.8], |
| 328 | + ], |
| 329 | + dtype="|S20", |
| 330 | +) |
| 331 | +polar.plot = "polar plot" |
| 332 | +polar.format = "floatdot0" |
| 333 | +polar.xaxis = 0 |
| 334 | +polar.format_row = "str" |
| 335 | +polar.labels_row = ["theta", "r"] |
| 336 | +polar.visualize() |
| 337 | + |
| 338 | + |
| 339 | +############################################################################### |
| 340 | +# |
| 341 | +# .. image:: /_static/polar_plot.png |
| 342 | +# |
296 | 343 | # Close the service |
297 | 344 | # ----------------- |
298 | 345 | # |
|
0 commit comments