Graphics, Figures & Tablespst-plot | Scaling of a Function

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

pst-plot | Scaling of a Function

Post by svend_tveskaeg »

Hi all.

First of all, consider the following example:

Code: Select all

\documentclass{article}

\usepackage[hmargin=2.4cm,vmargin=3cm,headheight=14.5pt]{geometry}
\usepackage{mathtools}
\usepackage{pst-func,pst-plot,pstricks-add}

\begin{document}

\begin{figure}
\centering
\psset{algebraic,xunit=0.15cm,yunit=0.007cm}
\begin{pspicture}(150.5,-30)(218,940)
\readdata{\normal}{normal.txt}
\dataplot[plotstyle=dots,dotsize=4pt,dotstyle=o,color,linecolor=red,fillcolor=blue,fillstyle=solid]{\normal}
\psGauss[linecolor=red,mue=179.6215,sigma=6.766667,linewidth=2pt]{153}{210}
\psline{->}(150.5,0)(212,0)
\rput(218,0){\small H{\o}jde (\textup{cm})}
\psline{->}(152,-30)(152,900)
\rput(152,940){\small Antal}
\end{pspicture}
\end{figure}

\end{document}
I would like to scale the pre-defined \psGauss command from the pst-func package by a factor of 13427. (The specific factor comes from my data analyses; never mind that.)
Is it possible to scale the function and if so, how?

Thank you in advance!

PS. The data--collected in the file normal.txt--are attached.
Attachments
normal.txt
(591 Bytes) Downloaded 254 times
Last edited by svend_tveskaeg on Wed Aug 24, 2011 5:06 pm, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

pst-plot | Scaling of a Function

Post by localghost »

You can give an option for the y units directly to the \psGauss command. And in general you can do your plot much more elegant as shown below.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pst-func,pst-plot,pstricks-add}

\begin{document}
  \begin{figure}[!ht]
    \centering
    \psset{%
      llx=-1.3cm,
      lly=-1cm,
      xAxisLabel={Højde (cm)},
      xAxisLabelPos={c,-120},
      yAxisLabel={Antal},
      yAxisLabelPos={-9,c},
    }
%    \psframebox[linestyle=dashed,linewidth=0.4pt]{%
    \begin{psgraph}[Ox=145,Dx=10,Dy=100]{->}(145,0)(215,900){10cm}{7cm}
      \readdata{\normal}{normal.txt}
      \dataplot[plotstyle=dots,dotsize=4pt,dotstyle=o,color,linecolor=red,fillcolor=blue,fillstyle=solid]{\normal}
      \psGauss[yunit=13427,linecolor=red,mue=179.6215,sigma=6.766667,linewidth=2pt]{153}{210}
    \end{psgraph}
%    }
  \end{figure}
\end{document}
The commented frame is only for checking the right trim size for the plot. For further customization of the plot refer to the pst-plot manual.


Thorsten
Attachments
Rendered output of the given code.
Rendered output of the given code.
pst-plot-scaled.png (15.6 KiB) Viewed 1914 times
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: pst-plot | Scaling of a Function

Post by svend_tveskaeg »

Thank you very much!
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply