tex >> How to plot a certain function (using PSTricks, perhaps)?

by Konrad Viltersten » Wed, 27 Jun 2007 14:43:34 GMT

I'm writing my master thesis and one of the images is
supposed to illustrate the properties of Brownian motion
and the Wiener process. Is there a built-in facility for
such a plot anywhere (the randomness needs not be there
as long as the plot captures the look-and-fell of the
processes).

One way to solve it would be to produce a set of points
and use that file to compile the image as a simple data
set but for numerous reasons i'll need to submit one,
single file (.TEX) and have no luxury of solving the matter
in such way, hance.

--
Vligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------



tex >> How to plot a certain function (using PSTricks, perhaps)?

by Alan Ristow » Wed, 27 Jun 2007 23:24:33 GMT





If it were me I'd plot it from a data file using PSTricks, but since you
say you can't use a data file you might try manually stringing together
coordinates using \psline:

\psline(0,0)(0.5,-0.1)(0.4,-0.2)(0.7,0.1)(1.1,0.3)...

Depending on how many points you wish to include it could get rather
tedious, especially if you make up the points as you go and decide it
doesn't look right. You could always write a script to generate the
\psline command from a set of data that you know looks right, though.

Alan



tex >> How to plot a certain function (using PSTricks, perhaps)?

by Herbert Voss » Wed, 27 Jun 2007 23:28:14 GMT




is it too difficult to go to http://PSTricks.tug.org and
searching for random??

Herbert


--
http://PSTricks.tug.org
http://tug.org/CTAN/info/math/voss/


How to plot a certain function (using PSTricks, perhaps)?

by anon k » Thu, 28 Jun 2007 01:45:24 GMT





Or, if Konrad prefers something like Excel over writing scripts,
spreadsheet formulas could easily generate code to copy and paste, as
well as providing a preview of the polygon to be drawn.

With a spreadsheet, the points and the number of points can be
repeatedly randomized until a scatter is achieved that communicates the
idea.

I guess that Excel code would look something like
="\psline(" & text(A1,"0") & "," & text(B1,"0") & ")" ...

MatLab could do it too.


How to plot a certain function (using PSTricks, perhaps)?

by Konrad Viltersten » Thu, 28 Jun 2007 05:17:40 GMT

Herbert Voss wrote/skrev/kaita/popisal/schreibt :




I only glazed fast at the code but of what i've seen , it's
almost exactly what i need. As always, you've been of
greatest value. I only say "i love you" to my mom and my
wife but you're about to transform that duo into a tripple.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------


How to plot a certain function (using PSTricks, perhaps)?

by Konrad Viltersten » Thu, 28 Jun 2007 05:18:28 GMT

anon k wrote/skrev/kaita/popisal/schreibt :





Thanks.

--
Vligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------



How to plot a certain function (using PSTricks, perhaps)?

by Dan » Thu, 28 Jun 2007 06:07:44 GMT




Note that Metapost has a normaldeviate operator.
You can get an approximation to a Brownian path with
the following code:

path bm;
pair B[];
numeric variance;
variance := 5;
B[0] := (0,0); % starts at (0,0)

for n=1 upto 100:
B[n] := B[n-1] + variance*(normaldeviate,normaldeviate);
endfor

bm := B[0]
for n = 1 upto 100:
--B[n]
endfor;
draw bm;

If you just want the data points B[], put
show B[n]; inside the for-loop where B[n]
is defined and read the results from the
..log file. The diameter of the plot should
be on the order of variance*sqrt n.

If you want to plot a one-dimensionl W(t) against t, just
change the loop defining B[n] to
numeric tscale; tscale = 1;
for n=1 upto 100:
B[n] := B[n-1] + (tscale, variance*normaldeviate);
endfor


Dan



How to plot a certain function (using PSTricks, perhaps)?

by Erik Quaeghebeur » Fri, 29 Jun 2007 04:32:10 GMT





The latest pgf/tikz release (1.18) also has some built-in support for
randomization. It might be somewhat easier than the (usually more
powerful) PSTricks route, certainly if you use pdflatex (which you should
at least consider because of microtype).


\begin{pedantic}
BTW, It's sense, not sence. Or is that a joke about lazy spelling I
didn't get?
\end{pedantic}

Erik


How to plot a certain function (using PSTricks, perhaps)?

by Herbert Voss » Fri, 29 Jun 2007 04:52:52 GMT






I always use microtype and, of course, PSTricks :-)



--
http://PSTricks.tug.org
http://www.dante.de/CTAN/info/math/voss/


How to plot a certain function (using PSTricks, perhaps)?

by Konrad Viltersten » Fri, 29 Jun 2007 20:14:27 GMT

Erik Quaeghebeur wrote/skrev/kaita/popisal/schreibt :



Thanks. I'll look into that too, allthough i already have almost
what i'll be happy with. Still, one can never have to much info.



It's a joke. Not really easily caught one, though, since you're
not the first person pointing that out. I ment for a while to
change it to the correct spelling not to cause other people the
annoyance but, guess what, i had to much _sence_ to do that... :)

--
Vligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------



How to plot a certain function (using PSTricks, perhaps)?

by Konrad Viltersten » Fri, 29 Jun 2007 20:16:24 GMT

Herbert Voss wrote/skrev/kaita/popisal/schreibt :






"microtype" - that's a new thing to me. Never seen that
before. I'll be off Wiking&Googling in a few minutes.
Is it something _instead_ of PSTricks or _on-top-of_ it?

--
Vligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------



How to plot a certain function (using PSTricks, perhaps)?

by Alan Ristow » Fri, 29 Jun 2007 21:48:37 GMT







It's an advanced typesetting package that performs minor typographical
adjustments like character protrusion and font expansion. Though minor,
the adjustments do wonders for the appearance of text. However, you have
to use pdfTeX to gain access to all of its feature -- only a subset are
available through regular TeX. That poses problems for PSTricks, which
is what Erik alluded to, but those problems can be worked around using
pst-pdf, which is what Herbert alluded to.

Alan


How to plot a certain function (using PSTricks, perhaps)?

by Dan » Sat, 30 Jun 2007 01:05:24 GMT

On Jun 29, 8:48 am, Alan Ristow < XXXX@XXXXX.COM >






Herbert could have been alluding to the fact that microtype
features are available even when pdftex is run in dvi mode.
In that case, pst-pdf isn't needed to use PStricks.


Dan



How to plot a certain function (using PSTricks, perhaps)?

by Alan Ristow » Sat, 30 Jun 2007 06:26:11 GMT









According to the microtype docs, automatic font expansion doesn't work
in DVI mode. Technically you can still use font expansion in DVI mode,
but as I understand it you then have to generate .tfm files and the
accompanying .map for every instance of an expanded font in your document.

Alan


Similar Threads

1. 3D plot using pstricks

2. How to plot functions of e in latex

Need to use psplot under latex to plot some functions of e, such as
log to the base e of (x+1) and e**(x+1)

Initial thoughtsthat they will be like these (where I substitute a 
constant for e below).

\psplot{-4}{4}{x 1 add ln}
\psplot{-4}{4}{e x 1 add exp}


T.I.A.

3. using Using Ghostscript on certain PDF files fails to generate thumbnails: Error: /undefined in --get--

4. series of plots / pstricks

Hello,

is it possible to include a series of graphs in a \dataplot (or alike). 
Somethings like

%datafile
x  y1  y2  y3 ...
x  y1  y2  y3 ...
...

that gives 4+ independent graphs, without creating x amount of input files?

And if so, is it also possible, to assign automatically different colors 
and/or linestyles for each graph?

I would like to avoid to include an Excel-charts, but creating an extra 
file for each line seems a lot of work ...

Thanks!

Tom

5. Density plots with PSTricks?

6. PStricks: mismatch between grid and plotted items.

Hi,

first of all sorry since I don't  have any source code to show.
(the machine I use is not my primary one).

I made a small figure with Latex and pstricks,
But I found out that the items I plot (a small circle let's say )
do not appear at the correct position on the grid
even if they should. :-(
This bug is somehow already described in a document called
"pstricks.bug" in the PStricks distribution.
Is there any workaround?

Luciano
ps.
Sorry again that I have no code to show,
if I get some feedback I will surely do it :-)


7. Unusual notation for functions in PSTricks

8. [latex][pstricks] Graph of mathematics function

hi
I am trying to learn LaTeX to write mathematics document.
I am on linux Mandrake edition 2005 and i use emacs.
I just want to make the graph of f(x)=6+3x-x
so I do that :

\documentclass{article}
\usepackage[pst-func]{pstricks}
\usepackage{pspicture}
\begin{document}
\begin{psppicture*}(-3,-5)(5,10)
\psaxes[Dy]{>>}(0,0)(-3,-5)(5,10)
\psset{linewidth=1.5pts}
\psPolynomial[coeff=6 3 -1,linecolor=red]{-3,5}
\end{pspicture*}
\end{document}

and the compilation gives the mesage :
!undefined control sequence
l.6 \psaxes
                [Dy=2]{>>}(0,0)(-3,-5)(5,10)
?
!undefined control sequence
l.8 \psPolynomial
?

someone here use pstricks and can explain mi how to have this graph please ?
thx for your answer
PS: sorry for mi english