myaxisc

版本 1.5.1 (37.6 KB) 作者: vik
Create axes object with multiple y-axis in Figure or App Designer
989.0 次下载
更新时间 2019/2/6

查看许可证

Object orientated approach for creating plots with three or more y axis. myaxisc, short for "Multiple Y Axis Class", is a class holding all the axes objects needed to display multiple Y axis. Second axis is placed on the right side, the additional axes are placed on the left side.

Features:
- Creates axes with as much additional Y axis as you want (as long as there is enough space, minimum are 2 y axis).
- Works with MATLAB App Designer as well as in regular Matlab Figures and therefore also in programmatic created GUIs.
- Full working zoom and pan functionality in App Designer UIFigures (extra buttons required) and in regular Figures using axtoolbar.
- When zoom or pan is not active, single y-axis can be panned.
- Includes some easy to use basic methods to modify appearance: Labels, Limits, Colors, FontSize, Position

Two example files (myaxisc_example.m and myaxisc_app.mlapp) are included to demonstrate usage.

Usage in regular Figures: Create myaxisc-object "h" and call plot with specified axes to plot into:
h = myaxisc(4,0.1); % Create myaxisc-object "h" with 4 y axes and a spacing of 0.1
plot(h.p(3),x,y) % Create plot in third axes using method "p"

Usage in App Designer: Its recommended to create a container panel to put the axes into. Use startupFcn to then create the axes into the container panel. See the attached example file for details. You need to add some functions and properties and also implement the buttons by yourself.

Installation: Nothing special, just make sure the myaxisc.m-File is in path.

There is a lot of compatibility coded into the class so it should behave the same way in App Designer UIFigures as well as in regular Figures and programmatic created Apps. Even though zooming and panning methods are implemented completely different, they should behave the same way. Unfortunately it is still possible to drag single line objects sometimes in uifigure so panning may behave buggy.

引用格式

vik (2024). myaxisc (https://www.mathworks.com/matlabcentral/fileexchange/70033-myaxisc), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2018b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Develop Apps Using App Designer 的更多信息
致谢

参考作品: plotyyy, ploty4.m, addaxis

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.5.1

Updated Screenshot

1.5

Added zooming and panning functionality in App Designer, fixed and allowed single axis-dragging

1.4

Added position argument, deconstructor for manual deletion, fixed missing axestoolbar, more input arguments

1.3

Added more compatibility to App Designer, updated examples

1.2.1

Fixed zip-archive

1.2

Added MATLAB App Designer Compatibility

1.0.1

Fixed Pan-Button in axtoolbar

1.0.0