plot crosshairs

버전 1.0.0.0 (59.9 KB) 작성자: Darren Weber
A gui interface for reading (x,y) values from line plot(s).
다운로드 수: 10.7K
업데이트 날짜: 2002/12/24

라이선스 없음

A set of mouse driven crosshairs is placed on the current axes, and displays the current (x,y) values of the line plot. There is an option to provide data specific values or interpolated values. The resolution of the data specific values depends on both the data resolution and the GUI interface (mainly mouse movement resolution). To overcome this limitation, there are next & previous buttons that move the x dimension of the crosshairs one point at a time. Interpolated values provide a more continuous function, however they too depend on the GUI interface resolution. There are currently no options for extrapolation. Further help is given in tool tips of the GUI.

For multiple traces, plots with the same length(xdata) are tracked. Each mouse click returns Xpoint,Ypoint values and selecting 'done' will remove the GUI and restore the mouse buttons to previous values. Selecting 'exit' will remove the GUI and close the figure.

The function now works across multiple plot figures (01/2002).

Useage: x = [1:10]; y(1,:) = sin(x); y(2,:) = cos(x);
figure; plot(x,y); crosshair

Note: crosshair always updates the Xpoint,Ypoint in the base workspace. Here is an example of how to get return values within a script/function after pressing the exit button of crosshair:
function [X,Y] = crosshair_returnXY
x = [1:10]; y(1,:) = sin(x); y(2,:) = cos(x);
figure; plot(x,y); crosshair;
uiwait
X = evalin('base','Xpoint');
Y = evalin('base','Ypoint');
return
Copy this text to a function .m file and then call it from the base workspace with [X,Y] = crosshair_returnXY

인용 양식

Darren Weber (2024). plot crosshairs (https://www.mathworks.com/matlabcentral/fileexchange/1038-plot-crosshairs), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R12
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Polar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

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

Additional version to handle subplots of a figure, crosshair_subplots.m