diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-24 23:18:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-24 23:18:04 +0000 |
commit | cb816f38f1e3873a1da8f2b33f2b630ccf8e8fa6 (patch) | |
tree | c63b1aab3c2ee6387acd9ccf4e077f81675d2952 /Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex | |
parent | eb6cd746c2e19735a17b67414c8b427fde92ce23 (diff) |
numericplots (21apr13)
git-svn-id: svn://tug.org/texlive/trunk@30097 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex new file mode 100644 index 00000000000..e0d6e518485 --- /dev/null +++ b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex @@ -0,0 +1,167 @@ + +\newlength{\origXLabelSep}\setlength{\origXLabelSep}{\baselineskip+1ex} +\newlength{\origYLabelSep}\setlength{\origYLabelSep}{7ex} +\newlength{\xLabelSep}\setlength{\xLabelSep}{\origXLabelSep} +\newlength{\yLabelSep}\setlength{\yLabelSep}{\origYLabelSep} + +\newlength{\TempLengthA} +\setlength{\TempLengthA}{0pt} +\newlength{\TempLengthB} +\setlength{\TempLengthB}{0pt} + +\newcommand{\NumDataPlotBaseline}{0} +\newcommand{\NumDataPlotDistance}{1} +\newcommand{\xLabelRefPt}{t} +\newcommand{\yLabelRefPt}{r} +\newcommand{\xLabelRot}{0} +\newcommand{\yLabelRot}{90} + + + +% ------------------------------------------------------------------------------ +% | keys for the put label commands +% ------------------------------------------------------------------------------ + +\define@cmdkeys[NumericDataPlot]{putxLabel}[NumDataPlotx]{ + LabelPos, LabelOption, LabelOrientation +} +\define@cmdkeys[NumericDataPlot]{putyLabel}[NumDataPloty]{ + LabelPos, LabelOption, LabelOrientation +} + +\define@key[NumericDataPlot]{putxLabel}{LabelSep}[\origXLabelSep]{\setlength{\xLabelSep}{#1}} +\define@key[NumericDataPlot]{putyLabel}{LabelSep}[\origYLabelSep]{\setlength{\yLabelSep}{#1}} + +\define@choicekey+[NumericDataPlot]{putxLabel}{ax}[\val\nrPutAxis] +{lower,upper}{ + \ifcase\nrPutAxis\relax + \renewcommand{\xLabelRot}{0} + \renewcommand{\xLabelRefPt}{t} + \renewcommand{\NumDataPlotBaseline}{\NumDataPlotyCoordMin} + \renewcommand{\NumDataPlotDistance}{-1} + \or + \renewcommand{\xLabelRot}{0} + \renewcommand{\xLabelRefPt}{b} + \renewcommand{\NumDataPlotBaseline}{\NumDataPlotyCoordMax} + \renewcommand{\NumDataPlotDistance}{1} + \fi +}{ + \PackageWarning{NumericPlots} + {Axis #1 not defined. Use left or right.} +} +\define@choicekey+[NumericDataPlot]{putyLabel}{ax}[\val\nrPutAxis] +{left,right}{ + \ifcase\nrPutAxis\relax + \renewcommand{\yLabelRot}{90} + \renewcommand{\yLabelRefPt}{b} + \renewcommand{\NumDataPlotBaseline}{\NumDataPlotxCoordMin} + \renewcommand{\NumDataPlotDistance}{-1} + \or + \renewcommand{\yLabelRot}{270} + \renewcommand{\yLabelRefPt}{b} + \renewcommand{\NumDataPlotBaseline}{\NumDataPlotxCoordMax} + \renewcommand{\NumDataPlotDistance}{1} + \fi +}{ + \PackageWarning{NumericPlots} + {Axis #1 not defined. Use left or right.} +} +% the LabelRefPt keys +\define@key[NumericDataPlot]{putxLabel}{LabelRefPt}{ + \renewcommand{\xLabelRefPt}{#1} +} +\define@key[NumericDataPlot]{putyLabel}{LabelRefPt}{ + \renewcommand{\yLabelRefPt}{#1} +} + +\newcommand\CheckIfColumntypeDefined[1]{% + \providebool{tpl@coltype@#1} + \ifcsdef{NC@find@\string#1}% + {\setbool{tpl@coltype@#1}{true}}% + {\ifcsdef{columntype@\string#1} + {\setbool{tpl@coltype@#1}{true}}% + {\setbool{tpl@coltype@#1}{false}}% + }% +} + +% ------------------------------------------------------------------------------ +% | standard values for the keys +% ------------------------------------------------------------------------------ + + +\newcommand{\StdLabelOption}{{}} + +\presetkeys[NumericDataPlot]{putxLabel}{ + LabelPos=0.5, LabelOption=\StdLabelOption{},LabelOrientation=c +}{} +\presetkeys[NumericDataPlot]{putyLabel}{ + LabelPos=0.5, LabelOption=\StdLabelOption{},LabelOrientation=c +}{} + + + + +% ============================================================================== +% || +% || axis labels +% || +% ============================================================================== +\newcommand{\PutLabelXaxis}[2][]{ + \setkeys*[NumericDataPlot]{putxLabel}{#1}% + % + \setcounter{BufferCounter}{10000*\ratio{\xLabelSep}{\CPicHeight}}% + \FPsub{\NumDataPlotBuffer}{\NumDataPlotGyPicMax}{\NumDataPlotGyPicMin}% + \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\theBufferCounter}% + \FPdiv{\NumDataPlotBuffer}{\NumDataPlotBuffer}{10000}% + \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotDistance}% + \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotBaseline}% + % + \rput[\xLabelRefPt]% + {\xLabelRot}% + (!\NumDataPlotxCoordRange\space \NumDataPlotxLabelPos\space mul % + \NumDataPlotxCoordMin\space add \NumDataPlotBuffer\space){% + \makeXLabel{#2}% + }% +} + +\newcommand{\makeXLabel}[1]{% + \NumDataPlotxLabelOption{}% + \testframe{% + \setlength{\tabcolsep}{0pt}% + \expandafter\tabular\NumDataPlotxLabelOrientation{}% + #1% + \endtabular% + }% +} + + +\newcommand{\PutLabelYaxis}[2][]{% + \setkeys*[NumericDataPlot]{putyLabel}{#1}% + % + \setcounter{BufferCounter}{10000*\ratio{\yLabelSep}{\CPicWidth}}% + \FPsub{\NumDataPlotBuffer}{\NumDataPlotGxPicMax}{\NumDataPlotGxPicMin}% + \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\theBufferCounter}% + \FPdiv{\NumDataPlotBuffer}{\NumDataPlotBuffer}{10000}% + \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotDistance}% + \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotBaseline}% + % + \rput[\yLabelRefPt]% + {\yLabelRot}% + (!\NumDataPlotBuffer\space % + \NumDataPlotyCoordRange\space \NumDataPlotyLabelPos\space mul % + \NumDataPlotyCoordMin\space add){% + \makeYLabel{#2}% + }% +} + +\newcommand{\makeYLabel}[1]{% + \NumDataPlotyLabelOption{}% + \testframe{% + \setlength{\tabcolsep}{0pt}% + \expandafter\tabular\NumDataPlotyLabelOrientation{}% + #1% + \endtabular% + }% +} + + |