percentlabel

버전 1.0.0.0 (4.44 KB) 작성자: Marc Jakobi
Converts axis tick labels and contour line labels to percentages
다운로드 수: 71
업데이트 날짜: 2016/10/5

라이선스 보기

PERCENTLABEL: Converts axis tick labels and contour line labels to percentages
Syntax:

percentlabel(h); Attempts to add a % symbol to all all
tick labels of the handle h

percentlabel(h, OptionName, OptionValue); With additional
options

clab = percentlabel(h); Return labels of
contour lines

Input arguments:

h: Figure or Axes handle.
It is recommended
to call this
function on an axes
handle.

Option-Value pairs

OptionName: OptionValue: Explanation:

'X' 'none' - Ignore x axis ticks
'normalized' - Convert from [0,1]-normalized XTickLabels
'absolute' (default) - add symbol without conversion

'Y' 'none' - Ignore y axis ticks
'normalized' - Convert from [0,1]-normalized YTickLabels
'absolute' (default) - add symbol without conversion

'C' 'none' - Ignore colorbar ticks
'normalized' - Convert from [0,1]-normalized colorbar TickLabels
'absolute' (default) - add symbol without conversion

Example:

percentlabel(gca, 'X', 'normalized', 'C', 'absolute')
--> converts normalizeden XTickLabels to percentages and adds a
percent symbol to the colorbar TickLabels

Option-Value pairs for contour line labels:

OptionName: OptionValue: Explanation:

'L' 'autoline' (default) - automatically add contour line labels
[xl, yl] - adds contour line labels to the coordinates at [xl, yl]
xl and yl are vectors containing
the X- and Y-coordinates of
the labels and must be combined into a
matrix.

'LMode' 'normalized' - converts normalized labels into percentages
'absolute' (default) - adds percentage symbols without conversion

'LAngle' 'default' (default) - add the labels centered from top left to bottom right
alpha - add the labels according to the
nearest points of a square cross section
with the angle alpha (starting from the
center)

Examoples:

clab = percentlabel(gca, 'L', 'autoline', 'LMode', 'absolute');
--> Automatic generation of contour line labels absolute
data

percentlabel(gca, 'L', [(x1; x2; x3), (y1; y2; y3)], 'LMode', 'normalized');
--> generates the labels at the coordinates set by
[xl,yl], where xl = [x1;x2;x3] and yl = [y1;y2;y3]
The data that is normalized to [0, 1] are converted into
percentages

percentlabel(gca, 'L', 'autoline', 'LAngle', -45)
--> Sets the labeling at an angle of approx. -45°.

Output argument:

clab: (optional) Cell-Array containing the text
objects of the contour line labels

Hint:
Percentlabel-Contour line labels can be found by typing:
findobj(gca,'Tag','percentlabel);

Author: Marc Jakobi - 18.06.2015

인용 양식

Marc Jakobi (2024). percentlabel (https://www.mathworks.com/matlabcentral/fileexchange/59508-percentlabel), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2016b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

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