[pstricks] How to improve this code to produce the same millimeter paper.

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Tue Jun 24 15:51:27 CEST 2003


Carlos Macedo schrieb:

>  After some efforts I got what I wanted, but with a horrible code!
>  My question is: How can I improve this code in a simple way?

simple is relative ;-) but multido is nice ...

Herbert

\documentclass[portuguese]{article}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{multido}
\usepackage{pstcol}
\usepackage{pst-plot}
\definecolor{orange}{cmyk}{0,0.61,0.87,0}
\pagestyle{empty}
\begin{document}

\begin{center}
\textbf{\Large Curva de equilíbrio}\\[1cm]
\psset{xunit=10cm,yunit=10cm}
\begin{pspicture}(-.01,-.01)(1,1)
\psgrid[subgriddiv=100,%
	gridlabels=0pt,%
	gridwidth=.01pt,%
	subgridcolor=orange](0,0)(1,1)
{\psset{linewidth=1pt,linecolor=orange}%
\multido{\R=.1+0.1}{9}{%
	\psline(\R,0)(\R,1)%
	\psline(0,\R)(1,\R)%
}}%
% something more optimized.
\psaxes[axesstyle=frame,Dx=.2,Dy=.2,linewidth=0.5pt,linewidth=1pt](0,0)(1,1)
\pscurve[linewidth=1.3pt]%
     (1,1)(.79,.90)(.644,.818)(.492,.707)(.382,.594)(.298,.498)%
     (.208,.379)(.120,.252)(.048,.127)(0,0)
\rput{90}(-.15,.5){\textbf{Fracção molar do benzeno no vapor, $y$}}
\rput[lb]{0}(.15,-.12){\textbf{Fracção molar do benzeno no líquido, $x$}}
\end{pspicture}
\end{center}

\end{document}




More information about the PSTricks mailing list