[pstricks] ploting a distribution around a circle
Leon Free
leon.free at free.fr
Thu Apr 10 11:05:49 CEST 2014
Le 09/04/2014 22:03, cyrille piatecki a écrit :
> Normaly a distribution like the normal one or any other is ploted along
> the line. But is there a way to do the same thing along a circle, that
> is in connecting the two extremes
>
> Has some one the answer ?
>
> Thanks
>
> Cyrille Piatecki
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
Hi,
As far as I understand, you want make a 3D plot of (x(t),y(t),z(t))
where (x(t),y(t)) are coordinates on the unit circle and z(t) is the
value of some density on the real line
You may use the object=curve of pst-solides3d :
\defFunction[algebraic]{mydensity}(t){x(t)}{y(t)}{z(t)}
\psSolid[object=courbe,r=.01,range=Min
Max,linecolor=red,linewidth=0.1,resolution=360,function=mydensity]
Of course you need to replace x(t),y(t),z(t) by some appropriate
functions of t. If you want (x(t),y(t)) to be on the unit circle, you
may use x(t)=cos(t) and y(t)=sin(t) and Min=0 and Max=2*pi. Then you
need to find a bijective g that maps [0,2*pi] onto the support A of your
density and define z(t) as zz(g(t)),
Here is a simple example where the density is the Kumaraswamy
distribution with parameter a=2 and b=5
(https://en.wikipedia.org/wiki/Kumaraswamy_distribution)
\documentclass{article}
\usepackage{pst-solides3d,pstricks}
\begin{document}
\psset{unit=0.5}
\begin{pspicture}(-4,-3)(4,4)
\psSolid[object=grille,base=-2 2 -2
2,linecolor=red,linewidth=0.5\pslinewidth]
\axesIIID(0,0,0)(2.5,2.5,2)
\defFunction[algebraic]{mydensity}(t)%
{cos(t)}%
{sin(t)}%
{10*(t/6.28)*(1-(t/6.28))^4}
\psSolid[object=courbe,r=.01,range=0
6.28,linewidth=0.1,resolution=360,function=mydensity]
\end{pspicture}
\end{document}
the bijective g is simply g(t)=t/2*pi
LF
More information about the PSTricks
mailing list