lammpskit.plotting.DualAxisPlotConfig

class lammpskit.plotting.DualAxisPlotConfig(alpha=0.55, linewidth=0.1, markersize=5, marker='^', primary_color='tab:red', secondary_color='tab:blue', format='pdf', primary_legend_loc='upper right', secondary_legend_loc='lower right', legend_framealpha=0.75, tight_layout=True, fontsize_title=8, fontsize_labels=8, fontsize_ticks=8, fontsize_legend=8)[source]

Configuration class for dual-axis plots supporting simultaneous visualization of two data series.

Enables comparison of time series data with different units or scales on a single figure. Essential for correlating physical quantities like temperature-displacement or connectivity-time relationships in scientific analysis. Provides independent color control and legend positioning for clear data interpretation.

alpha

Transparency level for both data series. Range [0.0, 1.0]. Moderate transparency allows underlying grid and axis lines to remain visible.

Type:

float, default=0.55

linewidth

Line thickness for both axes data. Thin lines prevent visual dominance of either dataset. Increase for presentation or when clarity is critical.

Type:

float, default=0.1

markersize

Marker size for scatter points on both axes. Consistent sizing maintains visual balance between primary and secondary data series.

Type:

float, default=5

marker

Marker style for secondary axis (right). Primary axis uses default scatter markers. Options: ‘o’, ‘s’, ‘^’, ‘*’, ‘+’, ‘x’, ‘D’, ‘v’, ‘<’, ‘>’.

Type:

str, default=’^’

primary_color

Color for primary (left) y-axis data and axis labels. Matplotlib tab colors provide good contrast. Options: ‘tab:blue’, ‘tab:orange’, ‘tab:green’, etc.

Type:

str, default=’tab:red’

secondary_color

Color for secondary (right) y-axis data and axis labels. Should contrast with primary_color for clear visual separation.

Type:

str, default=’tab:blue’

format

Output file format. Dual-axis plots benefit from vector formats to maintain text and line clarity at different scales.

Type:

str, default=’pdf’

primary_legend_loc

Legend position for primary axis data. Standard matplotlib locations: ‘upper/lower/center’ + ‘left/right/center’, or ‘best’ for automatic.

Type:

str, default=’upper right’

secondary_legend_loc

Legend position for secondary axis data. Should not overlap with primary legend. Consider ‘upper left’, ‘lower left’, or ‘center left’.

Type:

str, default=’lower right’

legend_framealpha

Background transparency for legend boxes. Range [0.0, 1.0]. Semi-transparent frames prevent complete data occlusion while maintaining readability.

Type:

float, default=0.75

tight_layout

Whether to apply matplotlib tight_layout for automatic spacing adjustment. Prevents axis label cutoff in dual-axis configurations.

Type:

bool, default=True

fontsize_title

Font size for plot title. Centered above both axes.

Type:

int, default=8

fontsize_labels

Font size for both primary and secondary axis labels.

Type:

int, default=8

fontsize_ticks

Font size for tick labels on both axes.

Type:

int, default=8

fontsize_legend

Font size for both legend boxes.

Type:

int, default=8

Notes

Dual-Axis Design Principles: - Color coding clearly distinguishes data series and corresponding axes - Legend positioning prevents data occlusion while maintaining clarity - Consistent marker sizing maintains visual balance between series - Semi-transparent legends allow underlying data visibility

Common Use Cases: - Temperature vs. displacement over time - Connectivity percentage vs. cluster size evolution - Voltage vs. current relationships in device characterization - Statistical metrics vs. physical properties correlation

Performance Considerations: - Dual-axis rendering requires additional matplotlib operations - Legend placement calculations may slow complex figures - Vector output formats recommended for text clarity

Examples

Default configuration for scientific analysis:

>>> config = DualAxisPlotConfig()
>>> print(f"Colors: {config.primary_color}, {config.secondary_color}")

Custom color scheme for publication:

>>> config = DualAxisPlotConfig(
...     primary_color='tab:green',
...     secondary_color='tab:purple',
...     primary_legend_loc='upper left',
...     secondary_legend_loc='upper right'
... )

High-contrast configuration for presentations:

>>> config = DualAxisPlotConfig(
...     alpha=0.9,
...     linewidth=0.5,
...     markersize=8,
...     legend_framealpha=0.9,
...     fontsize_title=12,
...     fontsize_labels=10
... )

Minimal styling for technical reports:

>>> config = DualAxisPlotConfig(
...     primary_color='black',
...     secondary_color='gray',
...     tight_layout=True,
...     format='eps'
... )
Parameters:
__init__(alpha=0.55, linewidth=0.1, markersize=5, marker='^', primary_color='tab:red', secondary_color='tab:blue', format='pdf', primary_legend_loc='upper right', secondary_legend_loc='lower right', legend_framealpha=0.75, tight_layout=True, fontsize_title=8, fontsize_labels=8, fontsize_ticks=8, fontsize_legend=8)
Parameters:

Methods

__init__([alpha, linewidth, markersize, ...])

Attributes

alpha

fontsize_labels

fontsize_legend

fontsize_ticks

fontsize_title

format

legend_framealpha

linewidth

marker

markersize

primary_color

primary_legend_loc

secondary_color

secondary_legend_loc

tight_layout

alpha: float = 0.55
linewidth: float = 0.1
markersize: float = 5
marker: str = '^'
primary_color: str = 'tab:red'
secondary_color: str = 'tab:blue'
format: str = 'pdf'
primary_legend_loc: str = 'upper right'
secondary_legend_loc: str = 'lower right'
legend_framealpha: float = 0.75
tight_layout: bool = True
fontsize_title: Optional[int] = 8
fontsize_labels: Optional[int] = 8
fontsize_ticks: Optional[int] = 8
fontsize_legend: Optional[int] = 8
__init__(alpha=0.55, linewidth=0.1, markersize=5, marker='^', primary_color='tab:red', secondary_color='tab:blue', format='pdf', primary_legend_loc='upper right', secondary_legend_loc='lower right', legend_framealpha=0.75, tight_layout=True, fontsize_title=8, fontsize_labels=8, fontsize_ticks=8, fontsize_legend=8)
Parameters: