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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
%%NAME
%% egridpol - draw polar grid
%%
%%SYNOPSIS
%% egridpol ([axisRadiusScale,axisAngleScale])
%%
%%PARAMETER(S)
%% axisRadiusScale scale vector of radius axis [start step end]
%% axisAngleScale scale vector of angle circle [start step end]
%%
%% special cases of scale vectors are:
%% if start=0 and end=0 then autorange=on
%% if step=0 then autoscale=on
%%
%%GLOBAL PARAMETER(S)
%% ePolarAxisRadScale
%% ePolarAxisAngScale
%% ePolarPlotAreaValStart
%% ePolarPlotAreaValEnd
%% ePolarPlotAreaCenterPos
%% ePolarPlotAreaRadMin
%% ePolarPlotAreaRadMax
%% ePolarPlotAreaAngStart
%% ePolarPlotAreaAngEnd
%% ePolarRadiusGridVisible
%% ePolarRadiusGridLineWidth
%% ePolarRadiusGridColor
%% ePolarRadiusGridDash
%% ePolarAngleGridVisible
%% ePolarAngleGridLineWidth
%% ePolarAngleGridColor
%% ePolarAngleGridDash
%% eAxesTicLongMaxN
% written by Stefan Mueller stefan.mueller@fgan.de
function egridpol(axisRadiusScale,axisAngleScale)
if nargin~=0 & nargin~=2
usage('egridpol ([axisRadiusScale,axisAngleScale])');
end
eglobpar;
if nargin==2
ePolarAxisRadScale=axisRadiusScale;
ePolarPlotAreaValStart=ePolarAxisRadScale(1);
ePolarPlotAreaValEnd=ePolarAxisRadScale(3);
ePolarAxisAngScale=axisAngleScale;
yRange=ePolarPlotAreaValEnd-ePolarPlotAreaValStart;
if yRange==0
yRange=1;
end
ePolarPlotAreaFac=(ePolarPlotAreaRadMax-ePolarPlotAreaRadMin)*...
eFac/yRange;
end
if nargin==0
if ePolarAxisRadScale(1)~=ePolarAxisRadScale(3)
ePolarPlotAreaValStart=ePolarAxisRadScale(1);
ePolarPlotAreaValEnd=ePolarAxisRadScale(3);
end
% scale and draw grids
if ePolarRadiusGridVisible
egridpr(eFile,...
ePolarPlotAreaCenterPos(1)*eFac,...
ePolarPlotAreaCenterPos(2)*eFac,...
ePolarPlotAreaRadMin*eFac,...
ePolarPlotAreaRadMax*eFac,...
ePolarPlotAreaAngStart,...
ePolarPlotAreaAngEnd,...
ePolarPlotAreaValStart,...
ePolarAxisRadScale(2),...
ePolarPlotAreaValEnd,...
eAxesTicLongMaxN,...
ePolarRadiusGridLineWidth*eFac,...
ePolarRadiusGridColor,...
ePolarRadiusGridDash*eFac);
end
if ePolarAngleGridVisible
maxValues=fix(20*(ePolarPlotAreaAngEnd-ePolarPlotAreaAngStart)/360);
egridpa(eFile,...
ePolarPlotAreaCenterPos(1)*eFac,...
ePolarPlotAreaCenterPos(2)*eFac,...
ePolarPlotAreaRadMin*eFac,...
ePolarPlotAreaRadMax*eFac,...
ePolarPlotAreaAngStart,...
ePolarPlotAreaAngEnd,...
ePolarAxisAngScale(1),...
ePolarAxisAngScale(2),...
ePolarAxisAngScale(3),...
maxValues,...
ePolarAngleGridLineWidth*eFac,...
ePolarAngleGridColor,...
ePolarAngleGridDash*eFac);
end
end
|