AeroViz 0.1.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AeroViz/__init__.py +13 -0
- AeroViz/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/data/DEFAULT_DATA.csv +1417 -0
- AeroViz/data/DEFAULT_PNSD_DATA.csv +1417 -0
- AeroViz/data/hysplit_example_data.txt +101 -0
- AeroViz/dataProcess/Chemistry/__init__.py +149 -0
- AeroViz/dataProcess/Chemistry/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Chemistry/_calculate.py +557 -0
- AeroViz/dataProcess/Chemistry/_isoropia.py +150 -0
- AeroViz/dataProcess/Chemistry/_mass_volume.py +487 -0
- AeroViz/dataProcess/Chemistry/_ocec.py +172 -0
- AeroViz/dataProcess/Chemistry/isrpia.cnf +21 -0
- AeroViz/dataProcess/Chemistry/isrpia2.exe +0 -0
- AeroViz/dataProcess/Optical/PyMieScatt_update.py +577 -0
- AeroViz/dataProcess/Optical/_IMPROVE.py +452 -0
- AeroViz/dataProcess/Optical/__init__.py +281 -0
- AeroViz/dataProcess/Optical/__pycache__/PyMieScatt_update.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/__pycache__/mie_theory.cpython-312.pyc +0 -0
- AeroViz/dataProcess/Optical/_derived.py +518 -0
- AeroViz/dataProcess/Optical/_extinction.py +123 -0
- AeroViz/dataProcess/Optical/_mie_sd.py +912 -0
- AeroViz/dataProcess/Optical/_retrieve_RI.py +243 -0
- AeroViz/dataProcess/Optical/coefficient.py +72 -0
- AeroViz/dataProcess/Optical/fRH.pkl +0 -0
- AeroViz/dataProcess/Optical/mie_theory.py +260 -0
- AeroViz/dataProcess/README.md +271 -0
- AeroViz/dataProcess/SizeDistr/__init__.py +245 -0
- AeroViz/dataProcess/SizeDistr/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/SizeDistr/__pycache__/_size_dist.cpython-312.pyc +0 -0
- AeroViz/dataProcess/SizeDistr/_size_dist.py +810 -0
- AeroViz/dataProcess/SizeDistr/merge/README.md +93 -0
- AeroViz/dataProcess/SizeDistr/merge/__init__.py +20 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v0.py +251 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v0_1.py +246 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v1.py +255 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v2.py +244 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v3.py +518 -0
- AeroViz/dataProcess/SizeDistr/merge/_merge_v4.py +422 -0
- AeroViz/dataProcess/SizeDistr/prop.py +62 -0
- AeroViz/dataProcess/VOC/__init__.py +14 -0
- AeroViz/dataProcess/VOC/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/VOC/_potential_par.py +108 -0
- AeroViz/dataProcess/VOC/support_voc.json +446 -0
- AeroViz/dataProcess/__init__.py +66 -0
- AeroViz/dataProcess/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/dataProcess/core/__init__.py +272 -0
- AeroViz/dataProcess/core/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/mcp_server.py +352 -0
- AeroViz/plot/__init__.py +13 -0
- AeroViz/plot/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/bar.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/box.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/pie.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/radar.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/regression.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/scatter.cpython-312.pyc +0 -0
- AeroViz/plot/__pycache__/violin.cpython-312.pyc +0 -0
- AeroViz/plot/bar.py +126 -0
- AeroViz/plot/box.py +69 -0
- AeroViz/plot/distribution/__init__.py +1 -0
- AeroViz/plot/distribution/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/distribution/__pycache__/distribution.cpython-312.pyc +0 -0
- AeroViz/plot/distribution/distribution.py +576 -0
- AeroViz/plot/meteorology/CBPF.py +295 -0
- AeroViz/plot/meteorology/__init__.py +3 -0
- AeroViz/plot/meteorology/__pycache__/CBPF.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/hysplit.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/__pycache__/wind_rose.cpython-312.pyc +0 -0
- AeroViz/plot/meteorology/hysplit.py +93 -0
- AeroViz/plot/meteorology/wind_rose.py +77 -0
- AeroViz/plot/optical/__init__.py +1 -0
- AeroViz/plot/optical/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/optical/__pycache__/optical.cpython-312.pyc +0 -0
- AeroViz/plot/optical/optical.py +388 -0
- AeroViz/plot/pie.py +210 -0
- AeroViz/plot/radar.py +184 -0
- AeroViz/plot/regression.py +200 -0
- AeroViz/plot/scatter.py +174 -0
- AeroViz/plot/templates/__init__.py +6 -0
- AeroViz/plot/templates/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/ammonium_rich.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/contour.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/corr_matrix.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/diurnal_pattern.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/koschmieder.cpython-312.pyc +0 -0
- AeroViz/plot/templates/__pycache__/metal_heatmap.cpython-312.pyc +0 -0
- AeroViz/plot/templates/ammonium_rich.py +34 -0
- AeroViz/plot/templates/contour.py +47 -0
- AeroViz/plot/templates/corr_matrix.py +267 -0
- AeroViz/plot/templates/diurnal_pattern.py +61 -0
- AeroViz/plot/templates/koschmieder.py +95 -0
- AeroViz/plot/templates/metal_heatmap.py +164 -0
- AeroViz/plot/timeseries/__init__.py +2 -0
- AeroViz/plot/timeseries/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/__pycache__/template.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/__pycache__/timeseries.cpython-312.pyc +0 -0
- AeroViz/plot/timeseries/template.py +47 -0
- AeroViz/plot/timeseries/timeseries.py +446 -0
- AeroViz/plot/utils/__init__.py +4 -0
- AeroViz/plot/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/_color.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/_unit.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/plt_utils.cpython-312.pyc +0 -0
- AeroViz/plot/utils/__pycache__/sklearn_utils.cpython-312.pyc +0 -0
- AeroViz/plot/utils/_color.py +71 -0
- AeroViz/plot/utils/_unit.py +55 -0
- AeroViz/plot/utils/fRH.json +390 -0
- AeroViz/plot/utils/plt_utils.py +92 -0
- AeroViz/plot/utils/sklearn_utils.py +49 -0
- AeroViz/plot/utils/units.json +89 -0
- AeroViz/plot/violin.py +80 -0
- AeroViz/rawDataReader/FLOW.md +138 -0
- AeroViz/rawDataReader/__init__.py +220 -0
- AeroViz/rawDataReader/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/__init__.py +0 -0
- AeroViz/rawDataReader/config/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/__pycache__/supported_instruments.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/config/supported_instruments.py +135 -0
- AeroViz/rawDataReader/core/__init__.py +658 -0
- AeroViz/rawDataReader/core/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/logger.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/pre_process.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/qc.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/__pycache__/report.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/core/logger.py +171 -0
- AeroViz/rawDataReader/core/pre_process.py +308 -0
- AeroViz/rawDataReader/core/qc.py +961 -0
- AeroViz/rawDataReader/core/report.py +579 -0
- AeroViz/rawDataReader/script/AE33.py +173 -0
- AeroViz/rawDataReader/script/AE43.py +151 -0
- AeroViz/rawDataReader/script/APS.py +339 -0
- AeroViz/rawDataReader/script/Aurora.py +191 -0
- AeroViz/rawDataReader/script/BAM1020.py +90 -0
- AeroViz/rawDataReader/script/BC1054.py +161 -0
- AeroViz/rawDataReader/script/EPA.py +79 -0
- AeroViz/rawDataReader/script/GRIMM.py +68 -0
- AeroViz/rawDataReader/script/IGAC.py +140 -0
- AeroViz/rawDataReader/script/MA350.py +179 -0
- AeroViz/rawDataReader/script/Minion.py +218 -0
- AeroViz/rawDataReader/script/NEPH.py +199 -0
- AeroViz/rawDataReader/script/OCEC.py +173 -0
- AeroViz/rawDataReader/script/Q-ACSM.py +12 -0
- AeroViz/rawDataReader/script/SMPS.py +389 -0
- AeroViz/rawDataReader/script/TEOM.py +181 -0
- AeroViz/rawDataReader/script/VOC.py +106 -0
- AeroViz/rawDataReader/script/Xact.py +244 -0
- AeroViz/rawDataReader/script/__init__.py +28 -0
- AeroViz/rawDataReader/script/__pycache__/AE33.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/AE43.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/APS.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Aurora.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/BAM1020.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/BC1054.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/EPA.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/GRIMM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/IGAC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/MA350.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Minion.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/NEPH.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/OCEC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Q-ACSM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/SMPS.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/TEOM.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/VOC.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/Xact.cpython-312.pyc +0 -0
- AeroViz/rawDataReader/script/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/tools/__init__.py +2 -0
- AeroViz/tools/__pycache__/__init__.cpython-312.pyc +0 -0
- AeroViz/tools/__pycache__/database.cpython-312.pyc +0 -0
- AeroViz/tools/__pycache__/dataclassifier.cpython-312.pyc +0 -0
- AeroViz/tools/database.py +95 -0
- AeroViz/tools/dataclassifier.py +117 -0
- AeroViz/tools/dataprinter.py +58 -0
- aeroviz-0.1.21.dist-info/METADATA +294 -0
- aeroviz-0.1.21.dist-info/RECORD +180 -0
- aeroviz-0.1.21.dist-info/WHEEL +5 -0
- aeroviz-0.1.21.dist-info/licenses/LICENSE +21 -0
- aeroviz-0.1.21.dist-info/top_level.txt +1 -0
AeroViz/plot/bar.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
import numpy as np
|
|
5
|
+
import pandas as pd
|
|
6
|
+
from matplotlib.pyplot import Figure, Axes
|
|
7
|
+
from pandas import DataFrame
|
|
8
|
+
|
|
9
|
+
from AeroViz.plot.utils import *
|
|
10
|
+
|
|
11
|
+
__all__ = ['bar']
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@set_figure(fw='bold')
|
|
15
|
+
def bar(data_set: DataFrame | dict,
|
|
16
|
+
data_std: DataFrame | None,
|
|
17
|
+
labels: list[str],
|
|
18
|
+
unit: str,
|
|
19
|
+
style: Literal["stacked", "dispersed"] = "dispersed",
|
|
20
|
+
orientation: Literal["va", "ha"] = 'va',
|
|
21
|
+
ax: Axes | None = None,
|
|
22
|
+
symbol=True,
|
|
23
|
+
**kwargs
|
|
24
|
+
) -> tuple[Figure, Axes]:
|
|
25
|
+
"""
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
data_set : pd.DataFrame or dict
|
|
29
|
+
A mapping from category names to a list of species mean or a DataFrame with columns as categories and values as means.
|
|
30
|
+
data_std : pd.DataFrame or None
|
|
31
|
+
A DataFrame with standard deviations corresponding to data_set, or None if standard deviations are not provided.
|
|
32
|
+
labels : list of str
|
|
33
|
+
The species names.
|
|
34
|
+
unit : str
|
|
35
|
+
The unit for the values.
|
|
36
|
+
style : {'stacked', 'dispersed'}, default 'dispersed'
|
|
37
|
+
Whether to display the bars stacked or dispersed.
|
|
38
|
+
orientation : {'va', 'ha'}, default 'va'
|
|
39
|
+
The orientation of the bars, 'va' for vertical and 'ha' for horizontal.
|
|
40
|
+
ax : plt.Axes or None, default None
|
|
41
|
+
The Axes object to plot on. If None, a new figure and Axes are created.
|
|
42
|
+
symbol : bool, default True
|
|
43
|
+
Whether to display values for each bar.
|
|
44
|
+
kwargs : dict
|
|
45
|
+
Additional keyword arguments passed to the barplot function.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
matplotlib.Axes
|
|
50
|
+
The Axes object containing the plot.
|
|
51
|
+
|
|
52
|
+
"""
|
|
53
|
+
# data process
|
|
54
|
+
data = data_set.values
|
|
55
|
+
|
|
56
|
+
if data_std is None:
|
|
57
|
+
data_std = np.zeros(data.shape)
|
|
58
|
+
else:
|
|
59
|
+
data_std = data_std.values
|
|
60
|
+
|
|
61
|
+
groups, species = data.shape
|
|
62
|
+
groups_arr = np.arange(groups)
|
|
63
|
+
species_arr = np.arange(species)
|
|
64
|
+
|
|
65
|
+
total = np.array([data.sum(axis=1), ] * species).T
|
|
66
|
+
|
|
67
|
+
pct_data = data / total * 100
|
|
68
|
+
data_cum = pct_data.cumsum(axis=1)
|
|
69
|
+
|
|
70
|
+
# figure info
|
|
71
|
+
category_names = kwargs.get('ticks') or list(data_set.index)
|
|
72
|
+
title = kwargs.get('title', '')
|
|
73
|
+
colors = kwargs.get('colors') or (Color.colors1 if species == 6 else Color.getColor(num=species))
|
|
74
|
+
|
|
75
|
+
fig, ax = plt.subplots(**kwargs.get('fig_kws', {})) if ax is None else (ax.get_figure(), ax)
|
|
76
|
+
|
|
77
|
+
if style == "stacked":
|
|
78
|
+
for i in range(species):
|
|
79
|
+
widths = pct_data[:, i]
|
|
80
|
+
starts = data_cum[:, i] - pct_data[:, i]
|
|
81
|
+
|
|
82
|
+
if orientation == 'va':
|
|
83
|
+
_ = ax.bar(groups_arr, widths, bottom=starts, width=0.7, color=colors[i], label=labels[i],
|
|
84
|
+
edgecolor=None, capsize=None)
|
|
85
|
+
else:
|
|
86
|
+
_ = ax.barh(groups_arr, widths, left=starts, height=0.7, color=colors[i], label=labels[i],
|
|
87
|
+
edgecolor=None, capsize=None)
|
|
88
|
+
if symbol:
|
|
89
|
+
ax.bar_label(_, fmt=auto_label_pct, label_type='center', padding=0, fontsize=8, weight='bold')
|
|
90
|
+
|
|
91
|
+
if style == "dispersed":
|
|
92
|
+
width = 0.1
|
|
93
|
+
block = width / 4
|
|
94
|
+
|
|
95
|
+
for i in range(species):
|
|
96
|
+
val = data[:, i]
|
|
97
|
+
std = (0,) * groups, data_std[:, i]
|
|
98
|
+
if orientation == 'va':
|
|
99
|
+
_ = ax.bar(groups_arr + (i + 1) * (width + block), val, yerr=std, width=width, color=colors[i],
|
|
100
|
+
edgecolor=None, capsize=None)
|
|
101
|
+
else:
|
|
102
|
+
_ = ax.barh(groups_arr + (i + 1) * (width + block), val, xerr=std, height=width, color=colors[i],
|
|
103
|
+
edgecolor=None, capsize=None)
|
|
104
|
+
if symbol:
|
|
105
|
+
ax.bar_label(_, fmt=auto_label_pct, label_type='center', padding=0, fontsize=8, weight='bold')
|
|
106
|
+
|
|
107
|
+
if orientation == 'va':
|
|
108
|
+
xticks = groups_arr + (species / 2 + 0.5) * (width + block) if style == "dispersed" else groups_arr
|
|
109
|
+
ax.set_xticks(xticks, category_names, weight='bold')
|
|
110
|
+
ax.set_ylabel(Unit(unit) if style == "dispersed" else '$Contribution (\\%)$')
|
|
111
|
+
ax.set_ylim(0, None if style == "dispersed" else 100)
|
|
112
|
+
ax.legend(labels, bbox_to_anchor=(1, 1), loc='upper left', prop={'size': 8})
|
|
113
|
+
|
|
114
|
+
if orientation == 'ha':
|
|
115
|
+
ax.invert_yaxis()
|
|
116
|
+
yticks = groups_arr + 3.5 * (width + block) if style == "dispersed" else groups_arr
|
|
117
|
+
ax.set_yticks(yticks, category_names, weight='bold')
|
|
118
|
+
ax.set_xlabel(Unit(unit) if style == "dispersed" else '$Contribution (\\%)$')
|
|
119
|
+
ax.set_xlim(0, None if style == "dispersed" else 100)
|
|
120
|
+
ax.legend(labels, bbox_to_anchor=(1, 1), loc='upper left', prop={'size': 8})
|
|
121
|
+
|
|
122
|
+
# fig.savefig(f"Barplot_{title}")
|
|
123
|
+
|
|
124
|
+
plt.show()
|
|
125
|
+
|
|
126
|
+
return fig, ax
|
AeroViz/plot/box.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import matplotlib.pyplot as plt
|
|
2
|
+
import numpy as np
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from matplotlib.pyplot import Figure, Axes
|
|
5
|
+
|
|
6
|
+
from AeroViz.plot.utils import *
|
|
7
|
+
|
|
8
|
+
__all__ = ['box']
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@set_figure
|
|
12
|
+
def box(df: pd.DataFrame,
|
|
13
|
+
x: str,
|
|
14
|
+
y: str,
|
|
15
|
+
x_bins: list | np.ndarray = None,
|
|
16
|
+
add_scatter: bool = True,
|
|
17
|
+
ax: Axes | None = None,
|
|
18
|
+
**kwargs
|
|
19
|
+
) -> tuple[Figure, Axes]:
|
|
20
|
+
fig, ax = plt.subplots(**kwargs.get('fig_kws', {})) if ax is None else (ax.get_figure(), ax)
|
|
21
|
+
|
|
22
|
+
df = df.dropna(subset=[x, y]).copy()
|
|
23
|
+
x_data, y_data = df[x].to_numpy(), df[y].to_numpy()
|
|
24
|
+
|
|
25
|
+
bins = np.array(x_bins)
|
|
26
|
+
bins = np.round(bins)
|
|
27
|
+
wid = (bins + (bins[1] - bins[0]) / 2)[0:-1]
|
|
28
|
+
|
|
29
|
+
df[x + '_bin'] = pd.cut(x=x_data, bins=bins, labels=wid)
|
|
30
|
+
|
|
31
|
+
group = x + '_bin'
|
|
32
|
+
column = y
|
|
33
|
+
grouped = df.groupby(group, observed=False)
|
|
34
|
+
|
|
35
|
+
names, vals = [], []
|
|
36
|
+
|
|
37
|
+
for i, (name, subdf) in enumerate(grouped):
|
|
38
|
+
names.append('{:.0f}'.format(name))
|
|
39
|
+
vals.append(subdf[column].dropna().values)
|
|
40
|
+
|
|
41
|
+
plt.boxplot(vals, labels=names, positions=wid, widths=(bins[1] - bins[0]) / 3,
|
|
42
|
+
showfliers=False, showmeans=True, meanline=True, patch_artist=True,
|
|
43
|
+
boxprops=dict(facecolor='#f2c872', alpha=.7),
|
|
44
|
+
meanprops=dict(color='#000000', ls='none'),
|
|
45
|
+
medianprops=dict(ls='-', color='#000000'))
|
|
46
|
+
|
|
47
|
+
ax.set(xlim=kwargs.get('xlim', (x_data.min(), x_data.max())),
|
|
48
|
+
ylim=kwargs.get('ylim', (y_data.min(), y_data.max())),
|
|
49
|
+
xlabel=kwargs.get('xlabel', Unit(x)),
|
|
50
|
+
ylabel=kwargs.get('ylabel', Unit(y)),
|
|
51
|
+
title=kwargs.get('title', ''))
|
|
52
|
+
|
|
53
|
+
ax.set_xticks(bins, labels=bins.astype(int))
|
|
54
|
+
|
|
55
|
+
if add_scatter:
|
|
56
|
+
for i, (name, subdf) in enumerate(grouped):
|
|
57
|
+
jitter = np.random.normal(0, 0.5, len(subdf))
|
|
58
|
+
ax.scatter([name] * len(subdf) + jitter, subdf[column], s=10, c='gray', alpha=0.5)
|
|
59
|
+
|
|
60
|
+
plt.show()
|
|
61
|
+
|
|
62
|
+
return fig, ax
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if __name__ == '__main__':
|
|
66
|
+
from AeroViz import DataBase
|
|
67
|
+
|
|
68
|
+
df = DataBase(load_data=True)
|
|
69
|
+
box(df, x='PM25', y='Extinction', x_bins=np.arange(0, 120, 10))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .distribution import *
|
|
Binary file
|
|
Binary file
|