Document ClassesNo image - PStricks

Information and discussion about specific document classes and how to create your own document classes.
sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

Hello all.

Trying to draw a graph, and PStrick looked good. But, I have ran into a problem.
I've installed pstricks via MikTeX package-utillity, and trying to generate a graph with this example-code from the PStricks webpage:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage{pstricks} 
\usepackage{pst-plot} 

\begin{document}

\begin{pspicture}(-0.25,-0.25)(8,8)
  \psgrid[gridlabels=0pt,subgriddiv=2,%
    gridcolor=lightgray,subgridcolor=lightgray]
  \psaxes[dx=1,Dx=2]{->}(0,0)(8,8)
\end{pspicture}

\end{document}
The problem is, no image is created. I've tried with several other example-code asa well and it's the same problem there. Does anyone know what the problem may be?

Thanks in advance!

Recommended reading 2024:

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

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

sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

Nevermind.
You cannot run your files with pdftex or pdflatex, see topic pdfoutput
sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

In the \begin{pspicture}(x,y)(x1,y1), does this have anything to do with the actual picture you are drawing? What is the connection between (x,y)(x1,y1), and the coordinates in for example the \psaxes(x,y)(x,y) which actually draw something?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No image - PStricks

Post by localghost »

All your questions are answered by the documentation of the PSTricks package and further the pstricks-add package. So refer to these documents to get the information you need.
sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

OK, I think I got it. Thanks.

And another question :roll:

Trying to make a histogram. Everything is going fine, except that I want the ticks to be on the same side as the labels. So I add the tickstyle=bottom, but it does not have any effect. I looked in code-examples, and I cant see anything wrong.

Code: Select all

\begin{pspicture}(0,0)(9,6)

\psset{yunit=1mm}
\psaxes[Dy=10,dy=1cm,Ox=-1,tickstyle=bottom,showorigin=false]{-|}(0,0)(0,0)(7,70)
\psline(0.7,0)(0.7,56)(1.3,56)(1.3,0)
\psline(1.7,0)(1.7,25)(2.3,25)(2.3,0)
\psline(2.7,0)(2.7,16)(3.3,16)(3.3,0)
\psline(3.7,0)(3.7,2)(4.3,2)(4.3,0)
\psline(4.7,0)(4.7,0)(5.3,0)(5.3,0)
\psline(5.7,0)(5.7,1)(6.3,1)(6.3,0)

\end{pspicture}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No image - PStricks

Post by localghost »

You have to add another option to the \psaxes command.

Code: Select all

\psaxes[Dy=10,dy=1cm,Ox=-1,showorigin=false,ticksize=-5pt 0]{-|}(0,0)(7,70)
The ticksize option overrides tickstyle. This is also described in Section 19.8 (ticksize, xticksize, yticksize) of the pstricks-add manual.
sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

Worked perfectly. Thank you localghost!

I think the manual which is linked to from PStricks-website is outdated (http://cgm.cs.mcgill.ca/~msuder/latex/pstricks.pdf, thats the manual I read..). It said nothing about the tickstyle-option being removed. Sorry!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No image - PStricks

Post by localghost »

If you followed the link i gave you above, it would have lead you to the pstricks-add manual. The pstricks package itself is the base of all other pst-xxx packages and is rather old. But its manual is far away from being outdated. The pstricks-add package contains bug fixes and enhancements to the original. I also wrote in my last post that the ticksize option is explained in the pstricks-add manual.
Last edited by localghost on Mon Apr 23, 2007 9:15 am, edited 1 time in total.
sveioen
Posts: 28
Joined: Tue Mar 06, 2007 1:04 am

No image - PStricks

Post by sveioen »

Does anyone know how this expression (Poisson distribution) is expressed with RPN? (need it in RPN form to plot in PStricks)

[url]http://www.matematikk.net/cgi-bin/mimetex.cgi?F(x)%20=%20\frac{e^{-0.68}*0.68^{x}}{x!}[/url]

F(x) = \frac{e^{-0.68}*0.68^{x}}{x!}




And by the way, this forum should really have TeX support :!:
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No image - PStricks

Post by localghost »

Take a look at the documentation of the pst-func package (Section 6.3 - Poisson Distribution, p. 24ff).
Post Reply