How to use fraction for PSTricks's coordinates?
(*{postfix constant} {infix expression in x})
(*-1 11/3)
is equal to TikZ(-1,11/3)
.Actually you can do more complicated for example
(*{0 1 sub} {11/3+0*x})
because the last can be any expression inx
.(+{infix constant},{infix expression in x})
(+-1,11/3)
is equal to TikZ(-1,11/3)
.Actually you can do more complicated for example
(+0-1,11/3+0*x)
because the last can be any expression inx
.
I recommend to always use {...}
for both abscissa and ordinate because it is the safest way. The current parser is not clever enough.
Summary:
For our reference in the future, let me write the summary as follows. The last one has not been implemented yet. Please contact the maintainer if you want to request the last feature. :-)
\documentclass[pstricks,border=1cm]{standalone}
\usepackage{pst-plot}
% the trailing spaces are intentionally added
\def\f{x/2 }
\def\F{2*y }
\pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix
\def\point[#1](#2){\pscircle*[linecolor=#1](#2){4pt}}
\begin{document}
\begin{pspicture}[showgrid](9,5)
% postfix constant and infix f(x)
\point[red](*{1 1 add} \f) % (2,f(2))=(2,1)
% infix constant and infix f(x)
\point[green](+8/2,\f) % (4,f(4))=(4,2)
% infix F(y) and postfix constant
\point[blue](**\F 1 2 add) % (F(3),3)=(6,3)
% Unfortunately,
% infix F(y) and infix constant
%\point[black](++\F,8/2) % (F(4),4)=(8,4)
% has not been implemented yet
% but we can use I2P as follows
\point[black](**\F {(8/2) I2P}) % (F(4),4)=(8,4)
\end{pspicture}
\end{document}