hachimiku is designed with a "consistent-by-default" philosophy. Most parameters related to styling, layout, and formatting are shared across all chart types (Bar, Line, CDF, etc.). This guide explains these common features.
- Color Management
- Legend Placement
- Spine and Border Styles
- Padding and Positioning
- Grid and Ticks
- Dynamic Font Scaling
All charts support the color_preset parameter. The default is academic_vivid, which uses high-contrast colors suitable for academic publications.
| Preset | Description |
|---|---|
academic_vivid |
(Default) Professional sequence (Green, Blue, Red, Orange, etc.) with high contrast. |
opt_warm |
Optimized warm tones (Red, Orange, Yellow). |
opt_cool |
Optimized cool tones (Blue, Cyan, Purple). |
By default, hachimiku places legends outside the plot area (usually at the top) to maximize the data visualization space.
legend_outside: Set toTrue(default) orFalse.legend_loc: Standard Matplotlib locations (e.g.,'upper left').legend_ncol: Number of columns in the legend.
You can control the visibility and style of the top and right "spines" (borders) using top_right_spine_style.
top_right_spine_style:'solid'(default, gray) or'none'(clean look).spine_linewidth: Controls the thickness of all axes.
Academic figures often require precise control over the placement of titles and labels.
title_y: Vertical position of the title (e.g.,-0.2for below the X-axis).xlabel_pad,ylabel_pad: Space between labels and axes.tick_pad: Space between tick labels and the axis line.
grid,grid_x,grid_y: Toggle grid visibility.grid_style: A dictionary of Matplotlib grid properties (e.g.,{'linestyle': '--', 'alpha': 0.5}).tick_direction:'in'(default) or'out'.
One of hachimiku's most powerful features is automatic font scaling. It calculates the optimal font size based on:
- The
figsizeof the figure. - The number of subplots (if using
LayoutManager).
This ensures that your labels are always readable, whether you are generating a small single-column figure or a large full-page mosaic. You can still override these using label_fontsize, tick_fontsize, etc.
See examples/common_features_gallery.py for the code used to generate the demonstrations in this guide.







