[pstricks] PSTricks Digest, Vol 172, Issue 4

Denis Vergès denis.verges at wanadoo.fr
Sat Jun 24 15:19:03 CEST 2017


Hello
Thanks, thanks and thanks  : Herbert is the greteast and PSTricks the most powerfull.

In fact this picture is in baccalauréat Asie 22 juin 2017 and I make this adaptation :

%%%%%%%%%
\psset{unit=6cm,comma=true}
\begin{pspicture}(-0.1,-0.1)(1.1,1.2)
\psgrid[gridlabels=0pt,gridwidth=0.2pt,subgridwidth=0.15pt](0,0)(1,1)
\multido{\n=0.1+0.2}{5}{\psline[linewidth=0.2pt](0,\n)(1,\n)}
\psaxes[linewidth=1.25pt,Dx=0.2,Dy=0.2,labelFontSize=\scriptstyle](0,0)(0,0)(1,1)
\psRandom[dotsize=4pt,dotstyle=o,fillstyle=solid,fillcolor=black,
  randomPoints=100](0,0)(1,1){%
    \pscustom[linestyle=none]{%
      \psline(0,1)
      \psplot[plotpoints=200]{0}{1}{1 x dup mul 1 add div }
      \psline(1,0)
}}
\psRandom[dotsize=4pt,dotstyle=o,fillcolor=white,
  randomPoints=100](0,0)(1,1){%
    \pscustom[linestyle=none]{%e
      \psline(0,1)(1,1)
      \psplot[plotpoints=200]{1}{0}{1 x dup mul 1 add div }
}}
\psplot[plotpoints=3000,linewidth=1.25pt,linecolor=cyan]{0}{1}{1 x dup mul 1 add div}
\rput(0.5,1.05){Illustration de la méthode avec $n = 100$}
\end{pspicture}
%%%%%%%%%
(Visible in :  http://www.apmep.fr/ecrire/?exec=articles&id_article=7481)

Have a nice Sunday.

Denis Vergès
> Le 24 juin 2017 à 12:00, pstricks-request at tug.org a écrit :
> 
> Send PSTricks mailing list submissions to
> 	pstricks at tug.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://tug.org/mailman/listinfo/pstricks
> or, via email, send a message with subject or body 'help' to
> 	pstricks-request at tug.org
> 
> You can reach the person managing the list at
> 	pstricks-owner at tug.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PSTricks digest..."
> 
> 
> Today's Topics:
> 
>   1. random points (Denis Verg?s)
>   2. Re: random points (Herbert Voss)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 23 Jun 2017 17:42:03 +0200
> From: Denis Verg?s <denis.verges at wanadoo.fr>
> To: pstricks at tug.org
> Subject: [pstricks] random points
> Message-ID: <96338EA0-C55F-4228-9523-C9DA00974116 at wanadoo.fr>
> Content-Type: text/plain; charset=utf-8
> 
> Dear PSTricks list
> 
> I had to plot 100 random points  in a square 0 <= x < =1 and 0 <= y <= 1.
> 
> In fact  if the point is under the curve \psplot[plotpoints=3000,linewidth=1.25pt,linecolor=cyan]{0}{1}{1 x dup mul 1 add div}
> the point is black  ; if the point is above the point is white.
> 
> How can I do ?
> 
> Thanks for advance ; in the book of H. Voss I don?t find the solution.
> 
> Denis Verg?s
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 23 Jun 2017 20:27:39 +0200
> From: Herbert Voss <Herbert.Voss at FU-Berlin.DE>
> To: pstricks at tug.org
> Subject: Re: [pstricks] random points
> Message-ID: <4ee9df4c-9a7e-8592-21f5-e96f82757e8c at FU-Berlin.DE>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> Am 23.06.2017 um 17:42 schrieb Denis Verg?s:
> 
>> I had to plot 100 random points  in a square 0 <= x < =1 and 0 <= y <= 1.
>> 
>> In fact  if the point is under the curve \psplot[plotpoints=3000,linewidth=1.25pt,linecolor=cyan]{0}{1}{1 x dup mul 1 add div}
>> the point is black  ; if the point is above the point is white.
> 
> \documentclass{article}
> \usepackage{pstricks-add}
> 
> \begin{document}
> \psset{unit=5cm}
> \begin{pspicture}(-0.1,-0.1)(1.1,1.1)
> \psRandom[dotsize=4pt,dotstyle=o,fillstyle=solid,fillcolor=black,
>   randomPoints=100](0,0)(1,1){%
>     \pscustom[linestyle=none]{%
>       \psline(0,1)
>       \psplot[plotpoints=200]{0}{1}{1 x dup mul 1 add div }
>       \psline(1,0)
> }}
> \psplot[linecolor=red,linewidth=1.5pt]{0}{1}{1 x dup mul 1 add div }
> \psaxes[dx=0.2,dy=0.2,Dx=0.2,Dy=0.2]{->}(0,0)(-0.1,-0.1)(1.1,1.1)
> \end{pspicture}
> 
> \end{document}
> 
> Herbert
> 
> 
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Bildschirmfoto vom 2017-06-23 20-26-50.png
> Type: image/png
> Size: 11969 bytes
> Desc: not available
> URL: <http://tug.org/pipermail/pstricks/attachments/20170623/ad9d0297/attachment-0001.png>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> 
> 
> ------------------------------
> 
> End of PSTricks Digest, Vol 172, Issue 4
> ****************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20170624/3b9c5531/attachment.html>


More information about the PSTricks mailing list