# 6.3.4 Polar Chart

**Polar Chart** is a common variation of circular graphs. It is useful when relationships between data points can be visualized most easily in terms of radiuses and angles.\
\
In **Polar Charts**, a series is represented by a closed curve that connects points in the polar coordinate system. Each data point is determined by the distance from the pole (the radial coordinate) and the angle from the fixed direction (the angular coordinate).

A polar chart represents data along the radial and angular axes. In Plolty, there are three types of polar chart: **Scatter polar chart, Line polar chart, and Bar polar chart.**

### 1. Scatter Polar Chart

```
import plotly.express as px
df = px.data.wind()
fig = px.scatter_polar(df, r="frequency", theta="direction")
fig.show()
```

![](https://998709212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB-ky7fVqjeXA6EcAbW%2F-MDFob0g6zEZrow0A_i-%2F-MDFpGhDcKd57Sd5U4-H%2FScreenshot%202020-07-27%20at%2017.10.56.png?alt=media\&token=77bdd351-f9e9-48ef-a20a-988dd735a0f4)

The "strength" column corresponds to strengthen wind categories, and there is a frequency value for each direction and strength. Below we use the strength column to **encode the color, symbol,  and size of the markers.**

```
fig = px.scatter_polar(df, r="frequency", theta="direction",
                       color="strength", symbol="strength", size="frequency",
                       color_discrete_sequence=px.colors.sequential.Viridis)
fig.show()
```

![](https://998709212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB-ky7fVqjeXA6EcAbW%2F-MDFWdYWMIX267p3KB-9%2F-MDFmPerJ772cAe8PrlY%2Fpolar.gif?alt=media\&token=5d439cb7-29fc-481c-b724-f6fb465b3898)

### 2. Line Polar Chart

```
fig = px.line_polar(df, r="frequency", theta="direction", color="strength", line_close=True,
                    color_discrete_sequence=px.colors.sequential.Agsunset)
fig.show()
```

![](https://998709212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB-ky7fVqjeXA6EcAbW%2F-MDFWdYWMIX267p3KB-9%2F-MDFmOlhf9uG0o4Ul5pr%2Flinepolar.gif?alt=media\&token=8646e37a-9e14-4e2d-a856-63f15197bf8c)

### 3. Bar Polar Chart

```
import plotly.graph_objects as go

fig = go.Figure(go.Barpolar(
    r=[5, 2.5, 1.5, 4.5, 4, 4, 3.5],
    theta=[65, 35, 180, 135, 300, 90, 270],
    width=[20,15,10,20,15,30,15,],
    marker_color=["olive", 'gold', 'orchid', 'cyan', 'salmon', 'forestgreen', 'dodgerblue'],
    marker_line_color="black",
    marker_line_width=3
))

fig.update_layout(
    template=None,
    polar = dict(
        radialaxis = dict(range=[0, 5.6], ),
        angularaxis = dict(showticklabels=False, ticks='')
))
fig.show()
```

![](https://998709212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB-ky7fVqjeXA6EcAbW%2F-MDFWdYWMIX267p3KB-9%2F-MDFmDQnoIAkjmeNQAJN%2FScreenshot%202020-07-27%20at%2016.00.09.png?alt=media\&token=871a451e-8b0c-4e66-b315-63d689a0788b)

### 4. Windrose Chart

A wind rose chart (also known as a polar bar chart) is a graphical tool used to visualize how wind speed and direction are typically distributed at a given location. We can use  `px.bar_polar` , or  use `go.Barpolar` .

![](https://998709212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB-ky7fVqjeXA6EcAbW%2F-MDFWdYWMIX267p3KB-9%2F-MDFmCDyz5EoE_RQGMQx%2FScreenshot%202020-07-27%20at%2016.02.31.png?alt=media\&token=1bc8fc65-c9fa-4960-908c-e1e4d2fc18b8)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vecco-insight.gitbook.io/crash-visualization/plotly/6.3-statistical-charts/6.3.4-polar-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
