mplot: Multiple plots in a single figure with list box selection

버전 1.1.0.0 (5.16 KB) 작성자: Levente Hunyadi
Adds multiple plot instructions to a figure and the user chooses which one to use from a list box.
다운로드 수: 1.7K
업데이트 날짜: 2010/10/2

라이선스 보기

mplot creates a figure with a list box and axes. The list box contains references to plot instructions to sketch data on the axes. Plot instructions are added to the list box with successive calls to the function mplot.

A plot instruction is either a function handle that takes at least a single argument, which is an axes handle; or a series of additional arguments passed to mplot, which are delegated unchanged to the built-in plot function.

When an item is selected in the list box, the corresponding instructions are used to plot data on the right-hand side axes. This means either calling the user-defined function with the axes handle as the first parameter, or the built-in plot function with all the additional arguments. When an item is double-clicked, a new figure window opens and data are plotted on a new pair of axes. This is useful when the axes are to be saved or exported.

EXAMPLES

mplot;
% creates an empty mplot figure if current figure is not already one

fig = mplot;
% returns the current figure handle in fig if it is an mplot figure, creating a new figure if needed

fig = mplot('new')
% unconditionally creates an empty mplot figure and returns its handle in fig

x = 1:100; y = rand(1,100); mplot(x, y, 'kx');
% adds a new plot to the currently active mplot figure; whenever the corresponding list item is clicked, plot(x,y,'kx') is executed

x = 1:100; y = rand(1,100); mplot(fig, x, y, 'kx');
% uses the specified mplot figure instead of the currently active one

x = 1:100; y = rand(1,100); mplot('my caption', x, y, 'kx');
% assigns the given caption to the newly added plot

fun = @(ax) plot(ax, x, y, 'k.'); mplot(fun);
% adds a new plot instruction given by a user function

인용 양식

Levente Hunyadi (2024). mplot: Multiple plots in a single figure with list box selection (https://www.mathworks.com/matlabcentral/fileexchange/27111-mplot-multiple-plots-in-a-single-figure-with-list-box-selection), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Interactive Control and Callbacks에 대해 자세히 알아보기
도움

받음: uisplitter

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Added reference to uisplitter.

1.0.0.0