Graphics, Figures & TablesPostfix expression and PSTricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Postfix expression and PSTricks

Post by coachbennett1981 »

I am trying to graph a simple exponential function in PSTRICKS. I have used what I believe is called postflix to plot y=2^x, as

Code: Select all

2 x exp
. How could I graph 2(.5)^x? I am messing with the graph but can't see to get it right.. I have tried the following

Code: Select all

2 .5* x exp
, but it does not give me what I need..

thank you in advance for any suggestions..


Nick

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Postfix expression and PSTricks

Post by coachbennett1981 »

Figured it out

.5(5)^x= 5 x exp .5 mul
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Postfix expression and PSTricks

Post by localghost »

Code: Select all

\documentclass{minimal}
\usepackage{pstricks-add}

\begin{document}
  \begin{psgraph}(0,0)(1,3){2cm}{!}   % x-y-axis with same unit
    \psplot[algebraic=true,linecolor=red]{0}{1}{0.5*5^x}
  \end{psgraph}
\end{document}
[1] Reverse Polish Notation - Wikipedia, the free encyclopedia


Best regards
Thorsten
Post Reply