diff options
author | Karl Berry <karl@freefriends.org> | 2013-09-19 23:15:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-09-19 23:15:08 +0000 |
commit | 7d20726c049fe3f539dfc3458a5f542d182eafaa (patch) | |
tree | 1208ba74ec623bdfa764d300bb84df1b1e99b5d8 /Master/texmf-dist/tex/latex/numericplots | |
parent | 046a18fe7e999f75ad01f2992df59bafd8396d5e (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')
-rw-r--r-- | Master/texmf-dist/tex/latex/numericplots/NumericPlots.sty | 138 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex | 41 |
2 files changed, 97 insertions, 82 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}} diff --git a/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex index e0d6e518485..f581eaf7e65 100644 --- a/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex +++ b/Master/texmf-dist/tex/latex/numericplots/NumericPlots_labels.tex @@ -11,10 +11,10 @@ \newcommand{\NumDataPlotBaseline}{0} \newcommand{\NumDataPlotDistance}{1} -\newcommand{\xLabelRefPt}{t} -\newcommand{\yLabelRefPt}{r} -\newcommand{\xLabelRot}{0} -\newcommand{\yLabelRot}{90} +% \newcommand{\xLabelRefPt}{t} +% \newcommand{\yLabelRefPt}{r} +% \newcommand{\xLabelRot}{0} +% \newcommand{\yLabelRot}{90} @@ -23,10 +23,10 @@ % ------------------------------------------------------------------------------ \define@cmdkeys[NumericDataPlot]{putxLabel}[NumDataPlotx]{ - LabelPos, LabelOption, LabelOrientation + LabelPos, LabelOption, LabelOrientation, LabelRot, LabelRefPt } \define@cmdkeys[NumericDataPlot]{putyLabel}[NumDataPloty]{ - LabelPos, LabelOption, LabelOrientation + LabelPos, LabelOption, LabelOrientation, LabelRot, LabelRefPt } \define@key[NumericDataPlot]{putxLabel}{LabelSep}[\origXLabelSep]{\setlength{\xLabelSep}{#1}} @@ -35,13 +35,11 @@ \define@choicekey+[NumericDataPlot]{putxLabel}{ax}[\val\nrPutAxis] {lower,upper}{ \ifcase\nrPutAxis\relax - \renewcommand{\xLabelRot}{0} - \renewcommand{\xLabelRefPt}{t} - \renewcommand{\NumDataPlotBaseline}{\NumDataPlotyCoordMin} + \setkeys[NumericDataPlot]{putxLabel}{LabelRot=0, LabelRefPt=t}% + \renewcommand{\NumDataPlotBaseline}{\NumDataPlotyCoordMin} \renewcommand{\NumDataPlotDistance}{-1} \or - \renewcommand{\xLabelRot}{0} - \renewcommand{\xLabelRefPt}{b} + \setkeys[NumericDataPlot]{putxLabel}{LabelRot=0, LabelRefPt=b}% \renewcommand{\NumDataPlotBaseline}{\NumDataPlotyCoordMax} \renewcommand{\NumDataPlotDistance}{1} \fi @@ -52,13 +50,11 @@ \define@choicekey+[NumericDataPlot]{putyLabel}{ax}[\val\nrPutAxis] {left,right}{ \ifcase\nrPutAxis\relax - \renewcommand{\yLabelRot}{90} - \renewcommand{\yLabelRefPt}{b} + \setkeys[NumericDataPlot]{putyLabel}{LabelRot=90, LabelRefPt=b}% \renewcommand{\NumDataPlotBaseline}{\NumDataPlotxCoordMin} \renewcommand{\NumDataPlotDistance}{-1} \or - \renewcommand{\yLabelRot}{270} - \renewcommand{\yLabelRefPt}{b} + \setkeys[NumericDataPlot]{putyLabel}{LabelRot=270, LabelRefPt=b}% \renewcommand{\NumDataPlotBaseline}{\NumDataPlotxCoordMax} \renewcommand{\NumDataPlotDistance}{1} \fi @@ -66,13 +62,6 @@ \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} @@ -116,8 +105,8 @@ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotDistance}% \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotBaseline}% % - \rput[\xLabelRefPt]% - {\xLabelRot}% + \rput[\NumDataPlotxLabelRefPt]% + {\NumDataPlotxLabelRot}% (!\NumDataPlotxCoordRange\space \NumDataPlotxLabelPos\space mul % \NumDataPlotxCoordMin\space add \NumDataPlotBuffer\space){% \makeXLabel{#2}% @@ -145,8 +134,8 @@ \FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotDistance}% \FPadd{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotBaseline}% % - \rput[\yLabelRefPt]% - {\yLabelRot}% + \rput[\NumDataPlotyLabelRefPt]% + {\NumDataPlotyLabelRot}% (!\NumDataPlotBuffer\space % \NumDataPlotyCoordRange\space \NumDataPlotyLabelPos\space mul % \NumDataPlotyCoordMin\space add){% |