ThreeVector

版本 1.0.0.0 (33.4 KB) 作者: Daniel J O'Shea
Draws three-pronged labeled axis vectors that indicate 3d plot rotation
481.0 次下载
更新时间 2014/3/28

查看许可证

This class draws three vectors in the lower, left corner of an axis which indicate the orientation of the x, y, and z axes using a three pronged symbol. The ends of the vectors are labeled according to the axis xlabel, ylabel, zlabel. It installs callback methods to update these axes vectors when the plot is zoomed, rotated, panned, or resized. It also updates the vector labels when xlabel, ylabel, zlabel are set, or xlim, ylim, or zlim are changed. ThreeVector also deals gracefully with figure save and load by appropriately finding and updating internal graphics objects handles on load.
Usage:

tv = ThreeVector()
install for current axis

tv = ThreeVector(axh)
install for specific axis. if already installed,
returns the handle to the previously installed instance after
calling update()

tv.update()
force an update on the axis associated with tv

ThreeVector.updateFigure(figh [== gcf])
update all axes with ThreeVector installed within figure figh.

ThreeVector.updateAxes(axh [== gca])
update axis axh if ThreeVector installed

ThreeVector.demo()
plot a demo surface and install ThreeVector

Properties: setting these will automatically result in an update()

fontSize : font size used for axis labels, defaults to get(axh, 'FontSize')

fontColor : 3 x 1 color vector or plot-color-string (e.g. 'k')
used to label axes, defaults to 0.1 gray

lineWidth : line width used for axis vectors

lineColor : 3 x 1 color vector or plot-color-string (e.g. 'k') for
axis vector lines, defaults to 0.4 gray

vectorLength : scalar length of all axis vectors in cm

textVectorNormalizedPosition : position of axis labels along vectors
in units normalized to the vector length. E.g. 1 is end of vector,
0.5 is halfway along vector, 1.5 is 1.5 times the length of the vector.

axisInset: 2 x 1 vector of offsets in cm from bottom left corner.
in the form [offsetFromLeft, offsetFromBottom]

Author: Dan O'Shea, {my first name} AT djoshea.com (c) 2014

NOTE: This class graciously utilizes code from the following authors:

MinLong Kwong: For computing the data to figure space coordinate transformation matrix.
http://www.mathworks.com/matlabcentral/fileexchange/43896

Malcolm Lidierth: For the isMultipleCall utility to prevent callback re-entrancy
http://undocumentedmatlab.com/blog/controlling-callback-re-entrancy/

引用格式

Daniel J O'Shea (2024). ThreeVector (https://www.mathworks.com/matlabcentral/fileexchange/46062-threevector), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2014a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Vector Volume Data 的更多信息

Community Treasure Hunt

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

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