Skip to content

radar

AeroViz.plot.radar

Attributes

__all__ module-attribute

__all__ = ['radar']

data module-attribute

data = [[0.88, 0.01, 0.03, 0.03, 0.0, 0.06, 0.01, 0.0], [0.07, 0.95, 0.04, 0.05, 0.0, 0.02, 0.01, 0.0], [0.01, 0.02, 0.85, 0.19, 0.05, 0.1, 0.0, 0.0], [0.02, 0.01, 0.07, 0.01, 0.21, 0.12, 0.98, 0.0], [0.01, 0.01, 0.02, 0.71, 0.74, 0.7, 0.3, 0.2]]

Classes

Color

Unit

Functions
load_jsonfile classmethod
load_jsonfile()

讀取 JSON 檔中數據并將其變成屬性

update_jsonfile classmethod
update_jsonfile(key, value)

更新JSON檔

del_jsonfile classmethod
del_jsonfile(key)

更新JSON檔

Functions

set_figure

set_figure(func=None, *, figsize: tuple | None = None, fs: int | None = None, fw: str = None, autolayout: bool = True)

combine_legends

combine_legends(axes_list: list[Axes]) -> tuple[list, list]

auto_label_pct

auto_label_pct(pct, symbol: bool = True, include_pct: bool = False, ignore: Literal['inner', 'outer'] = 'inner', value: float = 2)

linear_regression_base

linear_regression_base(x_array: ndarray, y_array: ndarray, columns: str | list[str] | None = None, positive: bool = True, fit_intercept: bool = True)

radar_factory

radar_factory(num_vars, frame='circle')

Create a radar chart with num_vars axes.

This function creates a RadarAxes projection and registers it.

Parameters:

Name Type Description Default
num_vars int

Number of variables for radar chart.

required
frame (circle, polygon)

Shape of frame surrounding axes.

'circle'

radar

radar(data, labels=None, legend_labels=None, **kwargs) -> tuple[Figure, Axes]

Creates a radar chart based on the provided data.

Parameters:

Name Type Description Default
data list of list

A 2D list where each inner list represents a factor, and each element within the inner lists represents a value for a species. Shape: (n_factors, n_species) Example: [[0.88, 0.01, 0.03, ...], [0.07, 0.95, 0.04, ...], ...]

required
labels list

A list of strings representing the names of species (variables). If provided, it should have the same length as the number of elements in each inner list of data. Example: ['Sulfate', 'Nitrate', 'EC', 'OC1', 'OC2', 'OP', 'CO', 'O3']

None
legend_labels list

A list of strings for labeling each factor in the legend. If provided, it should have the same length as the number of inner lists in data.

None
**kwargs dict

Additional keyword arguments to be passed to the plotting function. This may include 'title' for setting the chart title.

{}

Returns:

Type Description
tuple[Figure, Axes]

A tuple containing the Figure and Axes objects of the created plot.

Example

data = [[0.88, 0.01, 0.03, 0.03, 0.00, 0.06, 0.01, 0.00], [0.07, 0.95, 0.04, 0.05, 0.00, 0.02, 0.01, 0.00], [0.01, 0.02, 0.85, 0.19, 0.05, 0.10, 0.00, 0.00], [0.02, 0.01, 0.07, 0.01, 0.21, 0.12, 0.98, 0.00], [0.01, 0.01, 0.02, 0.71, 0.74, 0.70, 0.30, 0.20]] labels = ['Sulfate', 'Nitrate', 'EC', 'OC1', 'OC2', 'OP', 'CO', 'O3'] fig, ax = radar(data, labels=labels, title='Basecase')

Note

The first dimension of data represents each factor, while the second dimension represents each species.