/usr/share/octave/site/m/octave-epstk/ebar.m is in octave-epstk 2.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | %%NAME
%% ebar - get coordinates for bar-plotting
%%
%%SYNOPSIS
%% [xb yb]=ebar(y[,barWidth[,barNumber,clusterSize,[,x]])
%%
%%PARAMETER(S)
%% y vector of y-data
%% barWidth x-size of bars
%% if barWidth=0 then autosize
%% default: barWidth=0
%% barNumber number whithin the cluster
%% clusterSize total number of bars in one cluster
%% x vector of x-data
%%
%% xb vector of x-coodinates
%% yb vector of y-coodinates
% written by stefan.mueller@fhr.fraunhofer.de (C) 2012
function [xb,yb]=ebar(y,barWidth,barNumber,clusterSize,x)
eglobpar
if nargin>5 || nargin<1 || nargin==3
eusage('[xb yb]=ebar(y[,barWidth[,barNumber,clusterSize[,x]])');
end
n=length(y);
m=1:n;
if nargin<5
x=m;
end
if nargin<4
barNumber=1;
clusterSize=1;
end
xDiff=x(2:n)-x(1:n-1);
minDeltaX=min(xDiff);
if nargin<2 || barWidth==0
barWidth=0.7*minDeltaX/clusterSize;
end
barWidth=barWidth/2;
i=1:4:4*n;
yb=zeros(4*n,1);
yb(i(m)+1)=y(m);
yb(i(m)+2)=y(m);
xb=zeros(4*n,1);
xb(i(m))=x(m)-barWidth;
xb(i(m)+1)=x(m)-barWidth;
xb(i(m)+2)=x(m)+barWidth;
xb(i(m)+3)=x(m)+barWidth;
xb=xb+(barNumber*2-1-clusterSize)*barWidth;
if eXAxisSouthScaleType
xb=xb-minDeltaX/2;
end
|