version 1.2.0 (11.1 KB) by Rohan Kadambi
plotNAx is a plotting utility which can graph data (with formatting) across multiple y-axis with a shared x-axis.


Updated Mon, 08 Feb 2021 23:31:23 +0000

View License

plotNAx can be used to construct plot graphics with arbitrary placement of multiple plot groups on multiple arbitrarily aligned axis with significant flexibility using MATLAB's built-in plot and axes Name-Value pair options.

Calling Structure:
[parent, ax_list, pl_list] = plotNAx(global options,...
x1, y1, group 1 options,...
x2, y2, group 2 options,...
xn, yn, group n options)

While iterating over the provided plot groups, the function creates properly scaled axes as needed and places formatted data on them. The global options (generally) set formatting choices which affect all axes (e.g. forcing the color of YAxis to match that of the data on those axes). These global options are all sent as Name-Value pairs. The "group n options" in the calling structure can be (almost) any property set when calling plot(...) or axes(...). This includes the use of LineSpec and Name-Value pair arguments. See the header comment in plotNAx.m for more details. See Section 1 of plotNAx_test.m for some examples to get started.

Cite As

Rohan Kadambi (2022). plotNAx (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: plotyyy, addaxis, Plot with multiple Y-axes

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!