mgplot 0.2.25__tar.gz → 0.2.27__tar.gz

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.
Files changed (59) hide show
  1. {mgplot-0.2.25 → mgplot-0.2.27}/CHANGELOG.md +36 -0
  2. {mgplot-0.2.25 → mgplot-0.2.27}/PKG-INFO +23 -3
  3. {mgplot-0.2.25 → mgplot-0.2.27}/README.md +22 -2
  4. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/bar_plot.html +676 -518
  5. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/fill_between_plot.html +213 -186
  6. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/finalise_plot.html +10 -4
  7. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/growth_plot.html +446 -418
  8. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/line_plot.html +372 -346
  9. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/postcovid_plot.html +1 -0
  10. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/run_plot.html +17 -6
  11. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot.html +572 -445
  12. mgplot-0.2.27/docs/search.js +46 -0
  13. {mgplot-0.2.25 → mgplot-0.2.27}/pyproject.toml +1 -1
  14. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/bar_plot.py +87 -29
  15. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/utilities.py +2 -2
  16. mgplot-0.2.27/test/test_bar_horizontal.py +126 -0
  17. {mgplot-0.2.25 → mgplot-0.2.27}/uv.lock +101 -100
  18. mgplot-0.2.25/docs/search.js +0 -46
  19. {mgplot-0.2.25 → mgplot-0.2.27}/.claude/settings.local.json +0 -0
  20. {mgplot-0.2.25 → mgplot-0.2.27}/.gitignore +0 -0
  21. {mgplot-0.2.25 → mgplot-0.2.27}/.pylintrc +0 -0
  22. {mgplot-0.2.25 → mgplot-0.2.27}/.python-version +0 -0
  23. {mgplot-0.2.25 → mgplot-0.2.27}/LICENSE +0 -0
  24. {mgplot-0.2.25 → mgplot-0.2.27}/build-all.sh +0 -0
  25. {mgplot-0.2.25 → mgplot-0.2.27}/build-docs.sh +0 -0
  26. {mgplot-0.2.25 → mgplot-0.2.27}/docs/index.html +0 -0
  27. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/revision_plot.html +0 -0
  28. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/seastrend_plot.html +0 -0
  29. {mgplot-0.2.25 → mgplot-0.2.27}/docs/mgplot/summary_plot.html +0 -0
  30. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/__init__.py +0 -0
  31. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/axis_utils.py +0 -0
  32. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/colors.py +0 -0
  33. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/fill_between_plot.py +0 -0
  34. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/finalise_plot.py +0 -0
  35. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/finalisers.py +0 -0
  36. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/growth_plot.py +0 -0
  37. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/keyword_checking.py +0 -0
  38. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/line_plot.py +0 -0
  39. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/lint-all.sh +0 -0
  40. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/multi_plot.py +0 -0
  41. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/postcovid_plot.py +0 -0
  42. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/py.typed +0 -0
  43. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/revision_plot.py +0 -0
  44. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/run_plot.py +0 -0
  45. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/seastrend_plot.py +0 -0
  46. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/settings.py +0 -0
  47. {mgplot-0.2.25 → mgplot-0.2.27}/src/mgplot/summary_plot.py +0 -0
  48. {mgplot-0.2.25 → mgplot-0.2.27}/test/test-executed.ipynb +0 -0
  49. {mgplot-0.2.25 → mgplot-0.2.27}/test/test.ipynb +0 -0
  50. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_bar_string_index.py +0 -0
  51. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_chart_subdir.py +0 -0
  52. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_multi_series_ticks.py +0 -0
  53. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_splat_sequences.py +0 -0
  54. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_tick_relabel.py +0 -0
  55. {mgplot-0.2.25 → mgplot-0.2.27}/test/test_zorder.py +0 -0
  56. {mgplot-0.2.25 → mgplot-0.2.27}/test/zz-test-data/ocr_rba.csv +0 -0
  57. {mgplot-0.2.25 → mgplot-0.2.27}/test/zz-test-data/revisions.csv +0 -0
  58. {mgplot-0.2.25 → mgplot-0.2.27}/test/zz-test-data/summary.csv +0 -0
  59. {mgplot-0.2.25 → mgplot-0.2.27}/uv-upgrade.sh +0 -0
@@ -1,3 +1,39 @@
1
+ Version 0.2.27 - released 19-Jun-2026 (Canberra, Australia)
2
+
3
+ * bug fix
4
+ - get_color_list() in utilities.py now uses the matplotlib.colormaps
5
+ registry (colormaps["nipy_spectral"]) instead of the removed
6
+ matplotlib.cm.get_cmap(). cm.get_cmap was deprecated in matplotlib
7
+ 3.7 and removed in 3.9; this restored colour generation for charts
8
+ with more series than the predefined palettes cover under
9
+ matplotlib >= 3.9 (tested against 3.11.0)
10
+
11
+ ---
12
+
13
+ Version 0.2.26 - released 5-Jun-2026 (Canberra, Australia)
14
+
15
+ * enhancement
16
+ - added horizontal=True to bar_plot() (and bar_plot_finalise()):
17
+ plots grouped or stacked horizontal bars with category labels on
18
+ the y-axis and values along the x-axis. Designed for categorical
19
+ (string-indexed) data - ranked states, industries, expenditure
20
+ classes and the like. Bar annotations are placed at the bar ends
21
+ (or within bars), vertically centred. Sign-aware stacking
22
+ (negatives leftward, positives rightward) works as for vertical
23
+ stacked bars. horizontal=True with a PeriodIndex warns and falls
24
+ back to a vertical plot - period tick labelling is x-axis only
25
+ - bar_plot() with a single series now accepts one colour per bar:
26
+ if color is a sequence whose length matches the data, each bar is
27
+ painted individually (e.g. state colours on a ranked horizontal
28
+ bar chart). The in-bar annotation stroke effect picks the matching
29
+ per-bar colour. Multi-series colour semantics are unchanged
30
+ - added test/test_bar_horizontal.py covering string-index labels,
31
+ annotations, grouped/stacked, negative stacking, the PeriodIndex
32
+ fallback, per-bar colours, and label survival through
33
+ finalise_plot()
34
+
35
+ ---
36
+
1
37
  Version 0.2.25 - released 5-Jun-2026 (Canberra, Australia)
2
38
 
3
39
  * enhancement
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mgplot
3
- Version: 0.2.25
3
+ Version: 0.2.27
4
4
  Summary: mgplot is a time-series/PeriodIndex frontend for matplotlib
5
5
  Project-URL: Repository, https://github.com/bpalmer4/mgplot
6
6
  Project-URL: Homepage, https://github.com/bpalmer4/mgplot
@@ -68,8 +68,9 @@ All plot functions take a pandas Series or DataFrame with a PeriodIndex
68
68
  as the first argument and return a matplotlib Axes object. Keyword
69
69
  arguments control styling and behavior:
70
70
 
71
- - `bar_plot()` -- vertical bar plot (grouped or stacked) with intelligent
72
- PeriodIndex labeling
71
+ - `bar_plot()` -- bar plot (grouped or stacked) with intelligent
72
+ PeriodIndex labeling; `horizontal=True` plots categorical data as
73
+ horizontal bars (categories on the y-axis, values along the x-axis)
73
74
  - `fill_between_plot()` -- shaded region between two bounds (requires
74
75
  2-column DataFrame)
75
76
  - `growth_plot()` -- plots annual and periodic growth rates (requires
@@ -85,6 +86,25 @@ arguments control styling and behavior:
85
86
  - `summary_plot()` -- latest data point against historical range with
86
87
  z-score visualization
87
88
 
89
+ For ranked-category charts (states, industries, expenditure classes),
90
+ use `horizontal=True` with a string-indexed Series or DataFrame:
91
+
92
+ ```python
93
+ vacancies = vacancies.sort_values() # smallest at the bottom
94
+ mg.bar_plot_finalise(
95
+ vacancies,
96
+ horizontal=True,
97
+ annotate=True, # value labels at the bar ends
98
+ above=True,
99
+ x0=True, # zero line on the value axis
100
+ title="Job vacancies by industry",
101
+ xlabel="'000",
102
+ )
103
+ ```
104
+
105
+ `horizontal=True` is for categorical data: with a PeriodIndex it warns
106
+ and falls back to a vertical plot.
107
+
88
108
  Finalising Plots
89
109
  ----------------
90
110
  Once a plot is generated, finalise it with titles, labels, and save to file:
@@ -52,8 +52,9 @@ All plot functions take a pandas Series or DataFrame with a PeriodIndex
52
52
  as the first argument and return a matplotlib Axes object. Keyword
53
53
  arguments control styling and behavior:
54
54
 
55
- - `bar_plot()` -- vertical bar plot (grouped or stacked) with intelligent
56
- PeriodIndex labeling
55
+ - `bar_plot()` -- bar plot (grouped or stacked) with intelligent
56
+ PeriodIndex labeling; `horizontal=True` plots categorical data as
57
+ horizontal bars (categories on the y-axis, values along the x-axis)
57
58
  - `fill_between_plot()` -- shaded region between two bounds (requires
58
59
  2-column DataFrame)
59
60
  - `growth_plot()` -- plots annual and periodic growth rates (requires
@@ -69,6 +70,25 @@ arguments control styling and behavior:
69
70
  - `summary_plot()` -- latest data point against historical range with
70
71
  z-score visualization
71
72
 
73
+ For ranked-category charts (states, industries, expenditure classes),
74
+ use `horizontal=True` with a string-indexed Series or DataFrame:
75
+
76
+ ```python
77
+ vacancies = vacancies.sort_values() # smallest at the bottom
78
+ mg.bar_plot_finalise(
79
+ vacancies,
80
+ horizontal=True,
81
+ annotate=True, # value labels at the bar ends
82
+ above=True,
83
+ x0=True, # zero line on the value axis
84
+ title="Job vacancies by industry",
85
+ xlabel="'000",
86
+ )
87
+ ```
88
+
89
+ `horizontal=True` is for categorical data: with a PeriodIndex it warns
90
+ and falls back to a vertical plot.
91
+
72
92
  Finalising Plots
73
93
  ----------------
74
94
  Once a plot is generated, finalise it with titles, labels, and save to file: