[pstricks] define parameters

Michael Sharpe msharpe at ucsd.edu
Wed Oct 19 08:12:12 CEST 2011


On Oct 18, 2011, at 9:36 PM, Doris Behrendt wrote:

> herbert,
> 
> 
> On 18.10.2011, at 23:16, Herbert Voss wrote:
> 
>> Am 18.10.2011 19:52, schrieb Doris Behrendt:
>> 
>>> how can I get the following example to work?
>> 
>>> %\psaxes{->}(0,0)(!\xmin .1 add \ymin .1 add)(!\xmax .1 sub \ymax .1
>>> sub)%doesn't work
>>> \psaxes{->}(0,0)(!\xmin\space .1 add \ymin\space .1 add)(!\xmax\space .1
>>> sub \ymax\space .1 sub)%doesn't work
>>> %either
>> 
>> that is not possible for \psaxes. It never worked
>> with the ! notation. Only (#1,#2) are possible
>> 
> 
> 
> I tried, but this doesn't seem to solve my problem, look:
> 
> \documentclass[12pt]{article}
> \usepackage{pstricks}
> \usepackage{pst-plot,pst-func}
> \usepackage{pstricks-add}
> 
> 
> \newcommand{\achsenkreuz}[4]{%
> \psaxes[arrowscale=2]{->}(0,0)(#1,#2)(#3,#4)
> }
> 
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \begin{document}
> 
> 
> \def\xmin{-4}
> \def\xmax{4}
> \def\ymin{-4}
> \def\ymax{4}
> \def\links{\xmin .1 add}%!!!!!!!!!!!!!doesn't make sense, but I need something like this!
> %-------------------------------------> I need to first define the left coordinate of my picture, then to
> %-------------------------------------> compute automatically a number which is a little bit larger and use this one
> %-------------------------------------> as parameter in other commands, e.g. the above defined >>achsenkreuz<<
> \def\unten{#2 .1 add}
> \def\rechts{#3 .1 sub}
> \def\oben{#4 .1 sub}
> \begin{pspicture*}(\xmin,\ymin)(\xmax,\ymax)
> \achsenkreuz{\xmin}{\ymin}{\xmax}{\ymax}%works
> \achsenkreuz{\links}{\unten}{\rechts}{\oben}%does not work
> \end{pspicture*}
> \end{document}
> 
> 
> 
> 
> 
> can this be done?
> 


I don't know any way in pstricks to do exactly what you ask, but the psgraph environment does allow you to achieve the same effect---place white space around the edges of the actual range of the axes. The approach is in some ways inverse to what you seek, but equivalent.

Michael




More information about the PSTricks mailing list