3

Consider the following example by Thomas Söll at Manuel Luque's PSTricks blog:

% latex filename.tex
% dvips filename.dvi
% ps2pdf filename.ps

\documentclass[
  a4paper,
  landscape,
  12pt
]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[
  hmargin=2.4cm,
  vmargin=3cm
]{geometry}
\usepackage{
  pst-grad,
  pst-coil,
  pstricks-add
}

\psset{unit=1.3}

\pagestyle{empty}

%----------------------------------------------------------
%----- FlammenKontinuierlicher Farbverlauf bei Kurven -----
%----------------------------------------------------------
\makeatletter
\pst@addfams{pst-HSB}
\define@key[psset]{pst-HSB}{HueBegin}{%
  \def\PstParametricplotHSB@HueBegin{#1}}
\define@key[psset]{pst-HSB}{HueEnd}{%
  \def\PstParametricplotHSB@HueEnd{#1}}
\define@boolkey[psset]{pst-HSB}[Pst@]{HSB}[true]{}
\psset[pst-HSB]{HueBegin=0,HueEnd=1,HSB=true}
\psset{dimen=outer}

\def\parametricplotHSB{\pst@object{parametricplotHSB}}
\def\parametricplotHSB@i#1#2#3{{%
  \begin@ClosedObj
  \addto@pscode{%
    /t #1 def
    /dt #2 t sub \psk@plotpoints\space div def
    /t t dt sub def
    /Counter 0 def
    1 setlinejoin
    \psk@plotpoints {
      /t t dt add def
      /Counter Counter 1 add def
      #3
      \pst@number\psyunit mul exch
      \pst@number\psxunit mul exch
      1 Counter eq { moveto currentpoint /OldY ED /OldX ED }
        {\ifPst@HSB
          /PointY exch def
          /PointX exch def
          Counter \psk@plotpoints\space div
          \PstParametricplotHSB@HueEnd\space
          \PstParametricplotHSB@HueBegin\space sub mul
          \PstParametricplotHSB@HueBegin\space add
          1 1 sethsbcolor
          OldX OldY PointX PointY lineto lineto
          stroke
          PointX PointY moveto
      /OldX PointX def /OldY PointY def
        \else lineto \fi } ifelse
     } repeat }
   \end@ClosedObj}
  \ignorespaces}
\makeatother

%-------------------------------------------------------------------------------

\begin{document}

\begin{figure}[htbp]
\newhsbcolor{ColorC}{0.5 0.8 0}
\newhsbcolor{ColorD}{0.5 0.5 0.5}
\centering
\begin{pspicture}(-4,-5.8)(12,3.5)
\pspolygon[linewidth=3pt,linecolor=gray!40,linearc=0,bordercolor=black,border=1.1pt,fillstyle=gradient,gradmidpoint=0,gradangle=10,gradbegin=orange!80,gradend=white](-1.8,3.45)(-0.9,2)(-0.9,-1.6)(0.9,-1.6)(0.9,2.4)(-0.2,2.4)(-0.88,3.45)(-1.8,3.45)% Brennkammer mit F{\'u}llung
\pspolygon[linewidth=3pt,linecolor=gray!40,linearc=0,bordercolor=black,border=1.1pt](-1.8,3.45)(-0.9,2)(-0.9,-1.6)(0.9,-1.6)(0.9,2.4)(-0.2,2.4)(-0.88,3.45)(-1.8,3.45)% Brennkammer nur Rahmen
\pspolygon[linewidth=4pt,linecolor=gray!40,linearc=0,bordercolor=black,border=1.1pt](-1.85,-2.65)(8.75,-2.65)(8.75,3.45)(-1.85,3.45)% Rahmen des Kraftwerks
\pspolygon[fillstyle=solid,fillcolor=black, opacity=1,linewidth=0.8pt](-1.35,-0.92)(-1.25,-0.85)(-1,-0.85)(-1,-0.95)(-0.85,-0.95)(-0.85,-1.15)(-1,-1.15)(-1,-1.45)(-1.25,-1.45)(-1.35,-1.38)% Brenner
%-------------------
%----- Flammen -----
%-------------------
\pscustom[fillstyle=solid,fillcolor=yellow!50,linestyle=none]{%
  \pscurve(-0.87,-1)(-0.4,-0.75)(-0.55,-0.4)(-0.4,-0.13)
  \pscurve(-0.45,-0.33)(-0.2,-0.53)
  \psline(-0.2,-0.53)(-0.2,-0.97)
  \pscurve(-0.2,-0.97)(-0.6,-1.05)(-0.87,-1.01)
}
\pscustom[fillstyle=solid,fillcolor=yellow!50,linestyle=none]{%
  \pscurve(-0.2,-0.53)(-0.17,-0.35)(0.1,-0.1)
  \pscurve(0.1,-0.1)(-0.01,-0.4)(0,-0.6)
  \pscurve(0,-0.6)(0.04,-0.52)(0.16,-0.46)
  \pscurve(0.16,-0.46)(0.1,-0.6)(0.17,-0.8)(0,-0.98)(-0.2,-0.97)
  \psline(-0.2,-0.97)(-0.2,-0.53)
}
\pscustom[fillstyle=solid,fillcolor=yellow!50,linestyle=none]{%
  \pscurve(0.1,-0.7)(0.2,-0.6)(0.2,-0.36)(0.4,-0.1)
  \pscurve(0.4,-0.1)(0.31,-0.29)(0.33,-0.4)(0.39,-0.6)(0.3,-0.8)(0.1,-0.86)
  \psline(0.1,-0.86)(0.1,-0.7)
}
\psframe[linecolor=black,fillstyle=solid,fillcolor=black,opacity=1,linewidth=0.8pt](-1,-1.15)(-0.81,-0.95)
%-----------------------
%----- Kondensator -----
%-----------------------
\pscustom[linestyle=none,fillstyle=gradient,gradmidpoint=0,gradangle=0,gradbegin=white,gradend=magenta!80]{%
  \psarcn[liftpen=0](6.8,-0.2){2}{190}{165}
  \psline(!5.162 2 15 sin mul 0.2 sub)(5.162,0.92)(5.338,0.92)(!5.338 2 15 sin mul 0.2 sub)%
    (!6.312 2 15 sin mul 0.2 sub)(6.312,0.92)(6.488,0.92)(!6.488 2 15 sin mul 0.2 sub)
  \psarcn[liftpen=0](4.8,-0.2){2}{15}{-10}
  \closepath
}
\pscustom[fillstyle=gradient,linestyle=none,gradmidpoint=0,gradangle=0,gradbegin=blue!70,gradend=cyan!60]{%
  \psarcn[liftpen=0](6.8,-0.2){2}{195}{190}
  \psarcn[liftpen=0](4.8,-0.2){2}{-10}{-15}
  \closepath
}
\pscustom[linewidth=1.0pt]{%
  \psarcn[liftpen=0](6.8,-0.2){2}{195}{165}
  \psline(!5.162 2 15 sin mul 0.2 sub)(5.162,0.92)(5.338,0.92)(!5.338 2 15 sin mul 0.2 sub)%
    (!6.312 2 15 sin mul 0.2 sub)(6.312,0.92)(6.488,0.92)(!6.488 2 15 sin mul 0.2 sub)
  \psarcn[liftpen=0](4.8,-0.2){2}{15}{-15}
  \closepath
}
%------------------------
%----- Wasserwendel -----
%------------------------
\psset{coilheight=0.495,coilwidth=1.3cm,coilaspect=52}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=black,linewidth=0.07cm]{250}{720}}
\rput(0.235,0.4){%
  \parametricplotHSB[plotpoints=500,linewidth=1.73mm,HueBegin=0.6,HueEnd=0.84]{270}{90}{0.88 t cos mul 0.365 t sin mul}
}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=black,linewidth=0.07cm]{600}{1200}}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=magenta,linewidth=0.045cm]{470}{1200}}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=black,linewidth=0.07cm]{850}{1400}}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=magenta,linewidth=0.045cm]{850}{1400}}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=black,linewidth=0.07cm]{1260}{1550}}
\rput{90}(0,0){\psCoil[doubleline=true,linecolor=magenta,linewidth=0.045cm]{1220}{1550}}
%------------------------
\psline[linewidth=1.47mm,linecolor=magenta,linearc=0.15,bordercolor=black,border=1.1pt](0.2,1.943)(4.1,1.943)(4.1,1.6)
\psline[linewidth=1.47mm,linecolor=magenta,linearc=0.15,bordercolor=black,border=1.1pt](4.65,1.6)(4.65,1.943)(5.75,1.943)(5.75,1.6)
\psline[arrowinset=0,arrowscale=1.2,arrowlength=0.8,linewidth=0.6pt]{->}(5.25,0.5)(5.25,0.1)
\psline[arrowinset=0,arrowscale=1.2,arrowlength=0.8,linewidth=0.6pt]{->}(6.4,0.5)(6.4,0.1)
\pscircle[linewidth=0.8pt,fillstyle=solid,fillcolor=blue!20!green!70](8.3,-0.4){0.17}
\psline[linewidth=1.3mm,linecolor=blue!20!green!70,linearc=0.15,bordercolor=black,border=1.1pt]%
  (8.18,-0.4)(5.1,-0.4)(5.1,-0.1)(9.4,-0.1)(9.4,-1.2)
\psline[linewidth=1.3mm,linecolor=blue!20!green!70,linearc=0.15,bordercolor=black,border=1.1pt]%
  (8.423,-0.4)(9.1,-0.4)(9.1,-1.2)
%-----------------
%----- Fluss -----
%-----------------
\psset{linecolor=blue}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.05 sub}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.15 sub}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.25 sub}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.35 sub}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.45 sub}
\psplot{8.9}{9.8}{x 1600 mul sin 0.02 mul 1.55 sub}
%-------------------
%----- Turbine -----
%-------------------
\psset{linecolor=black}
\psframe[fillstyle=gradient,linecolor=black,gradmidpoint=0,gradangle=0,gradbegin=blue!20!green!70,gradend=green!10]%
  (3.9,0.9)(6.6,1.6)
\psline(4.9,0.9)(4.9,1.6)
%-----------------------------------
%----- Achse und Turbinenr{\'u}der -----
%-----------------------------------
\psframe[gradientHSB=true,linestyle=none,fillstyle=gradient,linecolor=black,gradmidpoint=0.4,gradangle=0,gradbegin=ColorC,gradend=ColorD](3.7,1.2)(8.47,1.3)
%-----------------------------------
\pspolygon[gradientHSB=true,linestyle=none,fillstyle=gradient,linecolor=black,gradmidpoint=0.5,gradangle=0,gradbegin=ColorC,gradend=ColorD](4,1.35)(4.8,1.5)(4.8,1.0)(4,1.15)
\pspolygon[fillstyle=vlines,hatchangle=0,hatchsep=2pt](4,1.35)(4.8,1.5)(4.8,1.0)(4,1.15)
%-----------------------------------
\pspolygon[gradientHSB=true,linestyle=none,fillstyle=gradient,linecolor=black,gradmidpoint=0.5,gradangle=0,gradbegin=ColorC,gradend=ColorD](5.0,1.5)(5.7,1.35)(5.70,1.15)(5.0,1.0)
\pspolygon[fillstyle=vlines,hatchangle=0,hatchsep=2pt](5.0,1.5)(5.7,1.35)(5.70,1.15)(5.0,1.0)
%-----------------------------------
\pspolygon[gradientHSB=true,linestyle=none,fillstyle=gradient,linecolor=black,gradmidpoint=0.5,gradangle=0,gradbegin=ColorC,gradend=ColorD](5.8,1.35)(6.5,1.5)(6.5,1.0)(5.8,1.15)
\pspolygon[fillstyle=vlines,hatchangle=0,hatchsep=2pt](5.8,1.35)(6.5,1.5)(6.5,1.0)(5.8,1.15)
%-----------------------------------
\psframe[fillstyle=solid,linecolor=black,fillcolor=blue!20!green!70,dimen=inner,opacity=0.6](3.8,1.05)(3.9,1.45)
\psframe[fillstyle=solid,linecolor=black,fillcolor=blue!20!green!70,dimen=inner,opacity=0.6](6.6,1.1)(6.7,1.4)
%---------------------------------
%----- Generator und Erreger -----
%---------------------------------
\psframe[fillstyle=gradient,linecolor=black,gradmidpoint=0,gradangle=0,gradbegin=blue!60!green!70,gradend=green!10,dimen=inner](6.95,1.1)(7,1.4)
\psframe[fillstyle=gradient,linecolor=black,gradmidpoint=0,gradangle=0,gradbegin=blue!60!green!70,gradend=green!10](7,0.9)(8,1.6)
\psframe[fillstyle=gradient,linecolor=black,gradmidpoint=0,gradangle=0,gradbegin=yellow!90,gradend=yellow!20,dimen=inner](8,1.05)(8.4,1.45)
\psline[linecolor=black,linewidth=0.8pt](7.7,0.9)(7.7,0.8)(8.3,0.8)
\psline[linecolor=black,linewidth=0.8pt](7.6,0.9)(7.6,0.7)(8.3,0.7)
\psline[linecolor=black,linewidth=0.8pt](7.5,0.9)(7.5,0.6)(8.3,0.6)
\rput[l](8.38,0.8){\psplot[linecolor=black,linewidth=0.6pt]{-0.01}{0.16}{x 2500 mul sin 0.02 mul}}
\rput[l](8.38,0.7){\psplot[linecolor=black,linewidth=0.6pt]{-0.01}{0.16}{x 2500 mul sin 0.02 mul}}
\rput[l](8.38,0.6){\psplot[linecolor=black,linewidth=0.6pt]{-0.01}{0.16}{x 2500 mul sin 0.02 mul}}
%---------------------------------
\pspolygon[fillstyle=solid,fillcolor=black](8.2,-0.4)(8.36,-0.31)(8.36,-0.49)
\psframe[fillstyle=vlines,hatchangle=90,hatchsep=1.5pt,hatchcolor=red,linewidth=0.8pt](2.2,-0.8)(2.8,-0.2)
\pscircle[linewidth=0.8pt,fillstyle=solid,fillcolor=blue!70](3.2,-1.1){0.25}
\pspolygon[fillstyle=solid,fillcolor=black](3.05,-1.1)(3.3,-0.96)(3.3,-1.24)
\psline[linewidth=1.47mm,linecolor=blue!70,linearc=0.15,bordercolor=black,border=1.1pt](0.2,0.035)(2.5,0.035)(2.5,-1.1)(2.99,-1.1)
\psline[linewidth=1.47mm,linecolor=blue!70,linearc=0.15,bordercolor=black,border=1.1pt](3.4,-1.1)(5.8,-1.1)(! 5.8 -2 15 sin mul 0.2 sub 0.0175 add)
\psset{arrowinset=0,arrowscale=1.2,arrowlength=0.8,linewidth=0.6pt,arrows=->}
\psline(1.6,0.035)(1.2,0.035)
\psline(0.2,0.82)(-0.2,0.85)
\psline(1.2,1.943)(1.6,1.943)
\psline(5.025,1.943)(5.425,1.943)
\psline(7.5,-0.4)(7.1,-0.4)
\psline(7.5,-0.1)(7.9,-0.1)
%---------------------------------
{\tiny
\rput[t](-0.85,3,1){\shortstack[l]{%
  Rauch-\strut\\[-0.5ex]\ \quad
  gas-\strut\\[-0.5ex]\qquad
  kanal\strut}
}
\rput[c](-1.2,-2){Brenner}
\psline[linewidth=0.6pt](-1.2,-1.9)(-1.2,-1.2)
\rput[c](0.25,-2){Brennkammer}
\psline[linewidth=0.6pt](0.25,-1.9)(0.25,-1.2)
\rput[l](2.9,-1.5){Pumpe}
\rput[lc](3.2,-0.3){\shortstack[l]{%
  Vor-\strut\\[-0.5ex]
  w{\"{a}}rm-\strut\\[-0.5ex]
  anlage}
}
\rput[c](2.7,2.7){Frischdampf}
\psline[linewidth=0.6pt](2.7,1.95)(2.7,2.55)
\psline[linewidth=0.6pt](1.77,0.035)(1.77,0.22)
\rput[b](1.77,.25){\shortstack{%
  Speise-\strut\\[-0.5ex]
  wasser\strut}
}
\rput[c](4.4,2.7){\shortstack[c]{%
  Hochdruck-\strut\\[-0.5ex]
  turbine\strut}
}
\psline[linewidth=0.6pt](4.4,1.5)(4.4,2.5)
\rput[c](6.1,2.7){\shortstack{%
  Niederdruck-\strut\\[-0.5ex]
  turbine\strut}
}
\psline[linewidth=0.6pt](6.1,1.5)(6.1,2.5)
\rput[c](7.5,2.7){Generator}
\psline[linewidth=0.6pt](7.5,1.5)(7.5,2.5)
\rput[c](8.15,2.3){\shortstack{%
  Erreger-\strut\\[-0.5ex]
  maschine\strut}
}
\psline[linewidth=0.6pt](8.15,1.4)(8.15,2.1)
\rput[l](3.8,0.1){\shortstack{%
  Konden-\strut\\[-0.5ex]
  sator\strut}
}
\psline[linewidth=0.6pt](4.5,0.1)(5.0,0.1)
\rput[c](7.7,-0.8){K{\"{u}}hlwasser}
\psline[linewidth=0.6pt](7.7,-0.4)(7.7,-0.6)
\rput[l](9.1,-1.8){Fluss}
}
%---------------------------------
\rput[l](-2,-4.5){%
\psset{ArrowFill=true,arrowinset=0,arrowscale=0.7,arrowlength=0.5,framearc=0.05,dimen=outer,linecolor=gray!40}%
\psline[linewidth=0.7cm]{->}(12,0)(14,0)
\psline[linewidth=0.2cm,linearc=0.3]{->}(12,-0.35)(12.5,-0.35)(12.5,-1.0)
\psframe[linecolor=black](10,-0.8)(12,0.8)
\psline[linewidth=0.9cm]{->}(8,0)(10,0)
\psline[linewidth=0.2cm,linearc=0.3]{->}(8,-0.45)(8.5,-0.45)(8.5,-1.1)
\psframe[linecolor=black](6,-0.8)(8,0.8)
\psline[linewidth=1.1cm]{->}(4,0)(6,0)
\psline[linewidth=0.2cm,linearc=0.3]{->}(4,-0.55)(4.5,-0.55)(4.5,-1.2)
\psframe[linecolor=black](2,-0.8)(4,0.8)
\psline[linewidth=1.3cm]{->}(0,0)(2,0)
\psline[linewidth=0.2cm,linearc=0.3]{->}(0,-0.65)(0.5,-0.65)(0.5,-1.3)
\psframe[linecolor=black](-2,-0.8)(0,0.8)%
\rput[c](3,0.3){\psframebox[linecolor=white]{Rohre}}
\rput[c](3,-0.3){\psframebox[linecolor=white]{Kessel}}
\rput[l](4.1,0.2){\footnotesize potentielle}
\rput[l](4.1,-0.3){\footnotesize Energie}
\textcolor{red}{%
\rput[l](0.1,0.2){\footnotesize thermische}
\rput[l](0.1,-0.3){\footnotesize Energie}
\rput[l](8.1,0.2){\footnotesize kinetische}
\rput[l](8.1,-0.3){\footnotesize Energie}
\rput[l](12.1,0.2){\footnotesize elektrische}
\rput[l](12.1,-0.3){\footnotesize Energie}
\rput[c](-1,0){\psframebox[linecolor=white]{Brenner}}
\rput[c](7,0){\psframebox[linecolor=white]{Turbine}}
\rput[c](11,0){Generator}
\rput[l](12.7,-0.85){\footnotesize WE}
\rput[l](8.7,-0.95){\footnotesize WE}
\rput[l](4.7,-1.05){\footnotesize WE}
\rput[l](0.7,-1.15){\footnotesize WE}
}}
\end{pspicture}
\end{figure}

\end{document}

output

When I try to scale the figure using, say, \psset{unit=1.3}, the helical part of the watertube inside the oven is not correctly drawn. Can anyone help me fix this?

3
  • I bet the problem is something like psset{coilheight=0.495,coilwidth=1.3cm,..} where you mix sizes with unit and without. When scaling the global unit you do not change sizes given in cm
    – papabravo
    Jun 24, 2013 at 7:48
  • @ratatosk That was exactly the problem! If you make your comment into an answer, I'll accept it. Jun 24, 2013 at 7:52
  • @ratatosk Will you please make the comment into an answer so that the question can be closed? Jun 24, 2013 at 22:36

2 Answers 2

5

A short answer as requested:

You should not mix absolute measures like coilwidth=1cm and relative measures like coilheight=0.495 because only the latter will be effected by \psset{unit=1.3}

4

It is very short as a comment.

In addition to @ratatosk's answer, you can scale the whole picture by using \psscalebox{<scale factor>}{<your picture>}. It works regardless of you are using absolute or relative measures.

Suggestions:

If you are confused in determining whether to use absolute or relative measures, here are the guide lines.

  • Use absolute measures only for properties that are not necessarily scaled up or down. The best candidates are linewidth. You can specify it as linewidth=3pt for instance.

  • Use relative measures for properties that might be necessarily scaled up or down. For example, the dimension of a rectangle \psframebox(3,4) .

4
  • Thanks. The original figure isn't mine. ;) Jun 25, 2013 at 22:53
  • @SvendTveskæg for info and credits: Is it possible to add external link for the figure inside Q ? Jun 26, 2013 at 2:08
  • @texenthusiast I can't remember where I found the LaTeX code; it was quite a long time ago (and I tend to forget things that aren't important to me). Jun 26, 2013 at 12:24
  • 1
    @SvendTveskæg Name Credits/Courtesy/Source/Reference/Citation are important :) I have added them in Q. Thanks for Q. Jun 26, 2013 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.