summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-09-19 23:15:08 +0000
committerKarl Berry <karl@freefriends.org>2013-09-19 23:15:08 +0000
commit7d20726c049fe3f539dfc3458a5f542d182eafaa (patch)
tree1208ba74ec623bdfa764d300bb84df1b1e99b5d8 /Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty
parent046a18fe7e999f75ad01f2992df59bafd8396d5e (diff)
numericplots (19sep13)
git-svn-id: svn://tug.org/texlive/trunk@31701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty')
-rw-r--r--Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty138
1 files changed, 82 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty b/Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty
index babea7d8338..ac10d4ae09c 100644
--- a/Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty
+++ b/Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty
@@ -141,7 +141,17 @@
\define@boolkey[NumericDataPlot]{Axis}{xLog}[true]{
\ifNumericDataPlot@Axis@xLog
\renewcommand{\LogxAxis}{log}
- \renewcommand{\LogxAxisLabel}[1]{$10^{##1}$}
+ \renewcommand{\LogxAxisLabel}[1]{
+ \ifthenelse{##1<1}{
+ \ifthenelse{##1>-1}{%
+ $10^{0}$%
+ }{%
+ $10^{##1}$%
+ }}%
+ {%
+ $10^{##1}$%
+ }%
+ }%
\else
\renewcommand{\LogxAxis}{}
\renewcommand{\LogxAxisLabel}[1]{$##1$}
@@ -151,7 +161,17 @@
\define@boolkey[NumericDataPlot]{Axis}{yLog}[true]{
\ifNumericDataPlot@Axis@yLog
\renewcommand{\LogyAxis}{log}
- \renewcommand{\LogyAxisLabel}[1]{$10^{##1}$}
+ \renewcommand{\LogyAxisLabel}[1]{
+ \ifthenelse{##1<1}{
+ \ifthenelse{##1>-1}{%
+ $10^{0}$%
+ }{%
+ $10^{##1}$%
+ }}%
+ {%
+ $10^{##1}$%
+ }%
+ }%
\else
\renewcommand{\LogyAxis}{}
\renewcommand{\LogyAxisLabel}[1]{$##1$}
@@ -341,10 +361,11 @@
\FPround{\NumDataPlotxMax}{\NumDataPlotxMax}{3}
\FPln{\NumDataPlotBuffer}{\NumDataPlotxMin}
\FPdiv{\NumDataPlotxMin}{\NumDataPlotBuffer}{\NumDataPlotLnTen}
- \FPround{\NumDataPlotxMin}{\NumDataPlotxMin}{3}
+ \FPround{\NumDataPlotxMin}{\NumDataPlotxMin}{3}
\renewcommand{\NumDataPlotDx}{1}
- \FPadd{\NumDataPlotBuffer}{\NumDataPlotxMin}{0.5}
- \FPtrunc{\NumDataPlotxO}{\NumDataPlotBuffer}{0}
+ \FPtrunc{\NumDataPlotBuffer}{\NumDataPlotxMin}{0}
+ \FPadd{\NumDataPlotxO}{\NumDataPlotBuffer}{1}
+ \FPround{\NumDataPlotxO}{\NumDataPlotBuffer}{0}
\fi
\FPsub{\NumDataPlotxRange}{\NumDataPlotxMax}{\NumDataPlotxMin}
@@ -456,7 +477,7 @@
\PutTickLabelXaxis[#1,x=\n]{\LogxAxisLabel{\n}}
}
% plot tick at origin
- \PutTickLabelXaxis[#1,x=\NumDataPlotxO]{\LogxAxisLabel{\NumDataPlotxO}}
+ \PutTickLabelXaxis[#1,x=\NumDataPlotxO]{\LogxAxisLabel{\NumDataPlotxO}}
}
\newcommand{\xLogSubGrid}[1]{
@@ -474,7 +495,9 @@
\fi
}
-\newcommand{\plotxGrid}{
+\newcommand{\plotxGrid}[1][NoGrid=false]{
+ \setkeys*[NumericDataPlot]{xAxis}{#1}
+
% plot gridline on right side of the origin
\mmultido{\n=\xCoordOrig+\NumDataPlotdx}{\TicksXRight}{
\plotxGridLine{\n}
@@ -498,51 +521,51 @@
\setrmkeys*[NumericDataPlot]{putxTickLabel}
\setrmkeys[NumericDataPlot]{xAxis}
- % plot grid, ticks and ticklabels
- \plotxGrid{}
-
+ % plot grid, ticks and ticklabels
+ \plotxGrid[#1]
- % plot lower axis
- \ifthenelse{\boolean{PlotLowerAxis}}
- {
- \psline{C-C}%
- (\NumDataPlotxCoordMin, \NumDataPlotyCoordMin)%
- (\NumDataPlotxCoordMax, \NumDataPlotyCoordMin)
- \ifNumericDataPlot@xAxis@NoTickLabel
- \else
- \plotxTickLabels{ax=lower,#1}
- \fi
- % plot label
- \ifNumericDataPlot@xAxis@NoLabel
- \else
- \PutLabelXaxis[ax=lower,#1]{#2}
- \fi
- %plot upper axis (boxed)
- \ifthenelse{\boolean{PlotUpperAxis}}{
- % plot upper axis
- \psline{C-C}%
- (\NumDataPlotxCoordMin,\NumDataPlotyCoordMax)%
- (\NumDataPlotxCoordMax,\NumDataPlotyCoordMax)
- }{}
- }{
- % plot upper axis (only upper axis)
- \ifthenelse{\boolean{PlotUpperAxis}}{
- % plot upper axis
- \psline{C-C}%
- (\NumDataPlotxCoordMin,\NumDataPlotyCoordMax)%
- (\NumDataPlotxCoordMax, \NumDataPlotyCoordMax)
- % plot ticklabels
- \ifNumericDataPlot@xAxis@NoTickLabel
- \else
- \plotxTickLabels{ax=upper,#1}
- \fi
- % plot label
- \ifNumericDataPlot@xAxis@NoLabel
- \else
- \PutLabelXaxis[ax=upper,#1]{#2}
- \fi
- }{}
- }
+
+ % plot lower axis
+ \ifthenelse{\boolean{PlotLowerAxis}}
+ {
+ \psline{C-C}%
+ (\NumDataPlotxCoordMin, \NumDataPlotyCoordMin)%
+ (\NumDataPlotxCoordMax, \NumDataPlotyCoordMin)
+ \ifNumericDataPlot@xAxis@NoTickLabel
+ \else
+ \plotxTickLabels{ax=lower,#1}
+ \fi
+ % plot label
+ \ifNumericDataPlot@xAxis@NoLabel
+ \else
+ \PutLabelXaxis[ax=lower,#1]{#2}
+ \fi
+ %plot upper axis (boxed)
+ \ifthenelse{\boolean{PlotUpperAxis}}{
+ % plot upper axis
+ \psline{C-C}%
+ (\NumDataPlotxCoordMin,\NumDataPlotyCoordMax)%
+ (\NumDataPlotxCoordMax,\NumDataPlotyCoordMax)
+ }{}
+ }{
+ % plot upper axis (only upper axis)
+ \ifthenelse{\boolean{PlotUpperAxis}}{
+ % plot upper axis
+ \psline{C-C}%
+ (\NumDataPlotxCoordMin,\NumDataPlotyCoordMax)%
+ (\NumDataPlotxCoordMax, \NumDataPlotyCoordMax)
+ % plot ticklabels
+ \ifNumericDataPlot@xAxis@NoTickLabel
+ \else
+ \plotxTickLabels{ax=upper,#1}
+ \fi
+ % plot label
+ \ifNumericDataPlot@xAxis@NoLabel
+ \else
+ \PutLabelXaxis[ax=upper,#1]{#2}
+ \fi
+ }{}
+ }
}
\newcommand{\repeatxAxis}{\plotxAxis[NoLabel, NoTickLabel]{}}
@@ -587,13 +610,14 @@
\ifNumericDataPlot@Axis@yLog
\FPln{\NumDataPlotBuffer}{\NumDataPlotyMax}
\FPdiv{\NumDataPlotyMax}{\NumDataPlotBuffer}{\NumDataPlotLnTen}
- \FPround{\NumDataPlotyMax}{\NumDataPlotyMax}{6}
+ \FPround{\NumDataPlotyMax}{\NumDataPlotyMax}{6}
\FPln{\NumDataPlotBuffer}{\NumDataPlotyMin}
\FPdiv{\NumDataPlotyMin}{\NumDataPlotBuffer}{\NumDataPlotLnTen}
\FPround{\NumDataPlotyMin}{\NumDataPlotyMin}{6}
\renewcommand{\NumDataPlotDy}{1}
- \FPadd{\NumDataPlotBuffer}{\NumDataPlotyMin}{0.5}
- \FPtrunc{\NumDataPlotyO}{\NumDataPlotBuffer}{0}
+ \FPtrunc{\NumDataPlotBuffer}{\NumDataPlotyMin}{0}
+ \FPadd{\NumDataPlotyO}{\NumDataPlotBuffer}{1}
+ \FPround{\NumDataPlotyO}{\NumDataPlotyO}{0}
\fi
\FPsub{\NumDataPlotyRange}{\NumDataPlotyMax}{\NumDataPlotyMin}
@@ -704,7 +728,9 @@
\fi
}
-\newcommand{\plotyGrid}{
+\newcommand{\plotyGrid}[1][NoGrid=false]{
+ \setkeys*[NumericDataPlot]{yAxis}{#1}
+
% plot gridline on right side of the origin
\mmultido{\n=\yCoordOrig+\NumDataPlotdy}{\TicksYRight}{
\plotyGridLine{\n}
@@ -746,7 +772,7 @@
\setrmkeys[NumericDataPlot]{yAxis}
% plot grid
- \plotyGrid
+ \plotyGrid[#1]
% plot left axis
\ifthenelse{\boolean{PlotLeftAxis}}