Graphics, Figures & TablesHow to scale diagram with pstricks?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
multiholle
Posts: 3
Joined: Wed May 20, 2009 10:13 am

How to scale diagram with pstricks?

Post by multiholle »

I drawed a diagram with pstricks. How could I scale the axes to increase the space between two points?

Code: Select all

\documentclass[a4paper,12pt]{report}
\usepackage{pst-plot}
\begin{document}

\def\data{
0.0 0
0.1 0
0.2 0
0.3 0
0.4 0.01
0.5 0.02
0.6 0.02
0.7 0.03
0.8 0.03
0.9 0.03
1.0 0.02
1.1 0.03
1.2 0.02
1.3 0.01
1.4 0.01
1.5 0.01
1.6 0.01
1.7 0
1.8 -0.01
1.9 -0.01
2.0 -0.01
2.1 -0.01
2.2 -0.01
2.3 -0.01
2.4 -0.01
2.5 -0.01
2.6 -0.01
2.7 0
2.8 0.01
2.9 0.02
3.0 0.02
3.1 0.03
3.2 0.03
3.3 0.03}

\psset{unit=20mm}
\begin{pspicture}(10,10)
   \listplot[plotstyle=dots,linecolor=red]{\data}
   \psaxes[Dx=1,Dy=0.1]{->}(0,0)(0,-0.4)(3.4,0.4)
\end{pspicture}

\end{document} 

Recommended reading 2024:

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

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

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to scale diagram with pstricks?

Post by gmedina »

Hi,

you can use xunit=<value> and yunit=<value>:

Code: Select all

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

\begin{document}

[code]\def\data{
0.0 0
0.1 0
0.2 0
0.3 0
0.4 0.01
0.5 0.02
0.6 0.02
0.7 0.03
0.8 0.03
0.9 0.03
1.0 0.02
1.1 0.03
1.2 0.02
1.3 0.01
1.4 0.01
1.5 0.01
1.6 0.01
1.7 0
1.8 -0.01
1.9 -0.01
2.0 -0.01
2.1 -0.01
2.2 -0.01
2.3 -0.01
2.4 -0.01
2.5 -0.01
2.6 -0.01
2.7 0
2.8 0.01
2.9 0.02
3.0 0.02
3.1 0.03
3.2 0.03
3.3 0.03}

\psset{xunit=20mm,yunit=70mm}
   \listplot[plotstyle=dots,linecolor=red]{\data}
   \psaxes[Dx=1,Dy=0.1]{->}(0,0)(0,-0.4)(3.4,0.4)

\end{document} 
1,1,2,3,5,8,13,21,34,55,89,144,233,...
multiholle
Posts: 3
Joined: Wed May 20, 2009 10:13 am

How to scale diagram with pstricks?

Post by multiholle »

thanks, works fine! the problem was tthe following code:

Code: Select all

\begin{pspicture}(10,10)
...
\end{pspicture}
Post Reply