summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-24 23:18:04 +0000
committerKarl Berry <karl@freefriends.org>2013-04-24 23:18:04 +0000
commitcb816f38f1e3873a1da8f2b33f2b630ccf8e8fa6 (patch)
treec63b1aab3c2ee6387acd9ccf4e077f81675d2952 /Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex
parenteb6cd746c2e19735a17b67414c8b427fde92ce23 (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_TickLabels.tex')
-rw-r--r--Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex144
1 files changed, 144 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex
new file mode 100644
index 00000000000..8a0d32ab0a8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_TickLabels.tex
@@ -0,0 +1,144 @@
+
+\newlength{\origXTickLabelSep}\setlength{\origXTickLabelSep}{1ex}
+\newlength{\origYTickLabelSep}\setlength{\origYTickLabelSep}{1ex}
+\newlength{\xTickLabelSep}\setlength{\xTickLabelSep}{\origXTickLabelSep}
+\newlength{\yTickLabelSep}\setlength{\yTickLabelSep}{\origYTickLabelSep}
+
+\newcommand{\xTickLabelRefPt}{t}
+\newcommand{\yTickLabelRefPt}{r}
+
+\newcommand{\NumDataPlotxTickBaseline}{0}
+\newcommand{\NumDataPlotxTickDistance}{0}
+\newcommand{\NumDataPlotyTickBaseline}{0}
+\newcommand{\NumDataPlotyTickDistance}{0}
+
+% ------------------------------------------------------------------------------
+% | keys for the put TickLabel commands
+% ------------------------------------------------------------------------------
+
+\define@key[NumericDataPlot]{putxTickLabel}{x}{
+ \FPsub{\NumDataPlotBuffer}{#1}{\NumDataPlotxMin}
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
+ \FPadd{\NDPputXcoord}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
+}
+
+
+\define@key[NumericDataPlot]{putyTickLabel}{y}{
+ \FPsub{\NumDataPlotBuffer}{#1}{\NumDataPlotyMin}
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotyDataCoordRatio}
+ \FPadd{\NDPputYcoord}{\NumDataPlotBuffer}{\NumDataPlotyCoordMin}
+}
+
+\define@key[NumericDataPlot]{putxTickLabel}{TickLabelRefPt}{
+ \renewcommand{\xTickLabelRefPt}{#1}
+}
+
+\define@key[NumericDataPlot]{putyTickLabel}{TickLabelRefPt}{
+ \renewcommand{\yTickLabelRefPt}{#1}
+}
+
+\define@cmdkeys[NumericDataPlot]{putxTickLabel}[NumDataPlotx]{
+ TickLabelOption, TickLabelRot
+}
+\define@cmdkeys[NumericDataPlot]{putyTickLabel}[NumDataPloty]{
+ TickLabelOption, TickLabelRot
+}
+\define@key[NumericDataPlot]{putxTickLabel}{TickLabelSep}[\origXTickLabelSep]{\setlength{\xTickLabelSep}{#1}}
+\define@key[NumericDataPlot]{putyTickLabel}{TickLabelSep}[\origYTickLabelSep]{\setlength{\yTickLabelSep}{#1}}
+
+\define@choicekey+[NumericDataPlot]{putxTickLabel}{ax}[\val\nrPutAxis]
+{lower,upper}{
+ \ifcase\nrPutAxis\relax
+ \renewcommand{\xTickLabelRefPt}{t}
+ \renewcommand{\NumDataPlotxTickBaseline}{\NumDataPlotyCoordMin}
+ \renewcommand{\NumDataPlotxTickDistance}{-1}
+ \or
+ \renewcommand{\xTickLabelRefPt}{b}
+ \renewcommand{\NumDataPlotxTickBaseline}{\NumDataPlotyCoordMax}
+ \renewcommand{\NumDataPlotxTickDistance}{1}
+ \fi
+}{
+ \PackageWarning{NumericPlots}
+ {Axis #1 not defined. Use lower or upper.}
+}
+
+\define@choicekey+[NumericDataPlot]{putyTickLabel}{ax}[\val\nrPutAxis]
+{left,right}{
+ \ifcase\nrPutAxis\relax
+ \renewcommand{\yTickLabelRefPt}{r}
+ \renewcommand{\NumDataPlotyTickBaseline}{\NumDataPlotxCoordMin}
+ \renewcommand{\NumDataPlotyTickDistance}{-1}
+ \or
+ \renewcommand{\yTickLabelRefPt}{l}
+ \renewcommand{\NumDataPlotyTickBaseline}{\NumDataPlotxCoordMax}
+ \renewcommand{\NumDataPlotyTickDistance}{1}
+ \fi
+}{
+ \PackageWarning{NumericPlots}
+ {Axis #1 not defined. Use left or right.}
+}
+
+
+% ------------------------------------------------------------------------------
+% | standard values for the keys for the put TickLabel commands
+% ------------------------------------------------------------------------------
+
+\newcommand{\StdTickLabelOption}{{}}
+
+\presetkeys[NumericDataPlot]{putxTickLabel}{
+ TickLabelOption=\StdTickLabelOption{}, TickLabelRot=0
+}{}
+\presetkeys[NumericDataPlot]{putyTickLabel}{
+ TickLabelOption=\StdTickLabelOption{}, TickLabelRot=0
+}{}
+
+
+
+% ==============================================================================
+% ||
+% || tick labels
+% ||
+% ==============================================================================
+
+
+\newcommand{\PutTickLabelXaxis}[2][]{%
+ \setkeys*[NumericDataPlot]{putxTickLabel}{#1}%
+ %
+ \setcounter{BufferCounter}{10000*\ratio{\xTickLabelSep}{\CPicHeight}}%
+ \FPsub{\NumDataPlotBuffer}{\NumDataPlotGyPicMax}{\NumDataPlotGyPicMin}%
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\theBufferCounter}%
+ \FPdiv{\NumDataPlotBuffer}{\NumDataPlotBuffer}{10000}%
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxTickDistance}%
+ \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxTickBaseline}%
+ %
+ \rput[\xTickLabelRefPt]{\NumDataPlotxTickLabelRot}%
+ (!\NDPputXcoord\space \NumDataPlotBuffer)%
+ {\makeXTickLabel{#2}}%
+}
+
+
+\newcommand{\makeXTickLabel}[1]{%
+ \testframe{\NumDataPlotxTickLabelOption{}#1}%
+}
+
+\newcommand{\PutTickLabelYaxis}[2][]{%
+ \setkeys*[NumericDataPlot]{putyTickLabel}{#1}%
+ %
+% \FPdiv{\NumDataPlotBufferI}{\getlengthwounit{\yTickLabelSep}}{\getlengthwounit{\CPicWidth}}
+ \setcounter{BufferCounter}{10000*\ratio{\yTickLabelSep}{\CPicWidth}}%
+ \FPsub{\NumDataPlotBuffer}{\NumDataPlotGxPicMax}{\NumDataPlotGxPicMin}%
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\theBufferCounter}%
+ \FPdiv{\NumDataPlotBuffer}{\NumDataPlotBuffer}{10000}%
+ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotyTickDistance}%
+ \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotyTickBaseline}%
+ %
+ \rput[\yTickLabelRefPt]{\NumDataPlotyTickLabelRot}%
+ (!\NumDataPlotBuffer\space \NDPputYcoord)%
+ {\makeYTickLabel{#2}}%
+}
+
+\newcommand{\makeYTickLabel}[1]{%
+ \testframe{\NumDataPlotyTickLabelOption{}#1}%
+}
+
+