Graphics, Figures & TablesInverse variation with PSTricks

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

Inverse variation with PSTricks

Post by coachbennett1981 »

If I were to plot, say y=5/x using postflix, how would I do that? I tried 5 x div, but I get a really funky graph. I am not smart enough to update my pstricks, so using algebraic in my plot does not work..

Any advice would help..

thank you

Nick

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Inverse variation with PSTricks

Post by localghost »

Don't you have an idea of how such graph would look like? If not, take for good measure a program like Gnuplot and plot this function. I see no problem with the sample below.

Code: Select all

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

\begin{document}
  \begin{psgraph}(0,0)(5,5){5cm}{!}   % x-y-axis with same unit
    \psplot{1}{5}{5 x div}
  \end{psgraph}
\end{document}
If this solves your problem, please mark the topic as solved by editing your initial post and choosing the green checkmark from the icon list.


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

Re: Inverse variation with PSTricks

Post by coachbennett1981 »

Thorsten,

Thank you again, I did that code, but must not have paid attention to the domain. Did not mean to waste your time, but thank you again!
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Inverse variation with PSTricks

Post by CrazyHorse »

localghost wrote:

Code: Select all

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

\begin{document}
  \begin{psgraph}(0,0)(5,5){5cm}{!}   % x-y-axis with same unit
    \psplot{1}{5}{5 x div}
  \end{psgraph}
\end{document}
better:

Code: Select all

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

\begin{document}
  \begin{psgraph}{->}(0,0)(5,5){5cm}{!}
    \psplot[yMaxValue=5,algebraic]{0.01}{5}{ 5/x }
  \end{psgraph}
\end{document}
Herbert
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Inverse variation with PSTricks

Post by localghost »

CrazyHorse wrote:better:

Code: Select all

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

\begin{document}
  \begin{psgraph}{->}(0,0)(5,5){5cm}{!}
    \psplot[yMaxValue=5,algebraic]{0.01}{5}{ 5/x }
  \end{psgraph}
\end{document}
Herbert
Yes, and of course I'm aware. But as the OP already mentioned, his package version at least doesn't support the algebraic option and an update is not possible at the moment. That's the reason why he has to use the postfix notation (see also related topics). And it is not sure that the yMaxValue option is alredy supported in that version.
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Inverse variation with PSTricks

Post by coachbennett1981 »

Thank you both for the help, I will hopefully figure out how to update my pstricks. I think I was lucky to even get it on my computer and working. I want to plot 5/x in both the I and III Quadrants on the coordinate plane, but when I do so, I get the asymptote line, is there anyway I can get rid of it?
Also, I could not show anything but the first quadrant using the psgraph feature, so I had to adjust the code.

Thanks Nick

Code: Select all

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

\begin{document}

 \psaxes{<->}(0,0)(5,5)(-5,-5)
    \psplot{-3}{8}{5 x div}
  
  
\end{document}
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Inverse variation with PSTricks

Post by CrazyHorse »

coachbennett1981 wrote:I will hopefully figure out how to update my pstricks. I think I was lucky to even get it on my computer and working. I want to plot 5/x in both the I and III Quadrants on the coordinate plane, but when I do so, I get the asymptote line, is there anyway I can get rid of it?
Also, I could not show anything but the first quadrant using the psgraph feature, so I had to adjust the code.
plot two curves, one for the 1st and one for the 3rd quadrant
or update PSTricks, then you can do it with one:

Code: Select all

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

\begin{document}

\begin{pspicture}(-5,-5)(5,5)
\psaxes{<->}(0,0)(5,5)(-5,-5)
    \psplot[yMaxValue=5]{-5}{5}{5 x div}
\end{pspicture}
 
\end{document}
which system do you have and what does the file list and the end of
your log file say?

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

Re: Inverse variation with PSTricks

Post by coachbennett1981 »

Herbert, I use TexShop and am currently updated to the newest version. I looked at the log list of One page, but I am not sure what I am looking for. I go to the log list, and I have several options:
~/library/logs
/library/logs
/private/var/log
Section 8.2 Recip

I can see the PDF statistics. I am sorry to be so much trouble, but I don't understand what I am looking for..
I feel like a new computer user on the phone trying to figure out a problem that seems so obvious.

Nick
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Inverse variation with PSTricks

Post by CrazyHorse »

coachbennett1981 wrote:Herbert, I use TexShop and am currently updated to the newest version. I looked at the log list of One page, but I am not sure what I am looking for. I go to the log list, and I have several options:
~/library/logs
/library/logs
/private/var/log
Section 8.2 Recip

I can see the PDF statistics. I am sorry to be so much trouble, but I don't understand what I am looking for..
I feel like a new computer user on the phone trying to figure out a problem that seems so obvious.
TeXShop is a gui and not the system like MacTeX or TeXLive.
After every latex or pdflatex run there exists a logfile
with the main file name and extension .log.

Herbert
Post Reply