Skip to content

Commit

Permalink
Documentation for polar plot (#210)
Browse files Browse the repository at this point in the history
Co-authored-by: JennaPaikowsky <[email protected]>
  • Loading branch information
phchen95 and JennaPaikowsky authored Dec 26, 2024
1 parent f1941cc commit 6e8298e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Binary file added doc/source/_static/polar_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions doc/source/examples_source/00-basic/02-plottype.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,53 @@
#
# .. image:: /_static/3d_scatter.png
#
# Visualize a polar plot
# --------------------------
#
# A polar plot is a plot type that visualizes the data point in a polar
# coordinate system. One common variation of a polar plot is a radar chart. The
# data position is determined by:

###############################################################################
# * Radius (r): The distance from the center of the polar plot, defined by
# the **yaxis** property.
# * Theta (θ): The direction of the point, measured in numeric degrees or
# categorical data, defined by the **xaxis** property.

###############################################################################
# .. note::
# * **Scatter polar** is the only available polar plot type for now.
# * The **theta (θ)** value is defined by the data type of the **xaxis**
# values:
#
# * If xaxis values have minus numeric value: The labels will be a list
# of symmetrical values from "**(-180°) - (180°)**".
# * If xaxis values are all positive values: The labeles will be from
# "**(0°) - (360°)**".
# * If xaxis values are categorical values: All xaxis values will be used
# to label.

polar = adr_service.create_item()
# We can use the same data as we use to visualize heatmap
polar.item_table = np.array(
[
["-180", "-135", "-90", "-45", "0", "45", "90", "135", "180"],
[8.2, 7.3, 10.6, 5.6, 5.9, 9.1, 2.4, 1.6, 4.8],
],
dtype="|S20",
)
polar.plot = "polar plot"
polar.format = "floatdot0"
polar.xaxis = 0
polar.format_row = "str"
polar.labels_row = ["theta", "r"]
polar.visualize()


###############################################################################
#
# .. image:: /_static/polar_plot.png
#
# Close the service
# -----------------
#
Expand Down

0 comments on commit 6e8298e

Please sign in to comment.