[RPL/2] [Bulk] Re: The documentation

BERTRAND Joël joel.bertrand at systella.fr
Mar 15 Aou 15:32:24 CEST 2006


Khanh-Dang Nguyen Thu Lam a écrit :
> BERTRAND Joël <joel.bertrand at systella.fr> wrote:
> 
>>	No problem. All docs are written with LaTeX.
> 
> 
> Great. I'll start writing the graphes and drawing chapter as soon as I
> have understood myself how it really works :)

	I can help you.

>>	You can send an example with your question. I hope I can help
>>you ;-)
> 
> 
> Well, I would like to plot a 2-variables function, whatever it is.

	In a first time, I use my last testing release (pre8q, but there is no 
great differences between the last beta available and this one, only 
several Makefile.am changes to build RPL/2 on workstation that does not 
use ISO-8859-15 locale by default. And gcc-4.1.2 on sparc refuses to 
build RPL/2 due to an internal bug...).

> I am running several problems:
> - how could I set the x-range, the y-range and the z-range (here, in
> WIREFRAME mode, but an answer for other modes would be helpful as well).

2D and 3D graphics:
*H, *W and *D : multiplies one of the dimensions of the graphic.
*S : multiplies all dimensions.
AUTOSCALE : dimensions are automatically choosen.

AXES : very complex function ;-)
Argument of AXES is allways a list. This list is formed by one or 
several internal lists and zero or one string. This strig can be "main" 
or "auxiliary" (case unsensitive) to indicate the system of axes.
I have written (expression 1) because I would indicate that it is 
possible to write { { 'pi/2' "ticsonly" 4 } { "automatic" } } axes.

The order of internal lists indicates axe (X, Y and in last position Z).
Internal lists are composed by several arguments :
- number1 = distance between two tics
- number2 = number of subtics between two tics.
- "automatic" : tics and graduations are given by RPL/2.
- "default" : default numbers of subtics between two tics.
- "ticsonly" : only draws tics.

Thus :
ESSAI
<<
     { { pi "ticsonly" 4 } { "automatic" } } axes
     { "auxiliary" { "ticsonly" 1 2 } { "ticsonly" 1 "default" } } axes
     'Y' autoscale << X sin >> steq draw drax persist
 >>

returns a plot with two axes systems. The function is displayed in 
"main" system. Auxiliary system is not used, only displayed.

ESSAI2
<<
     << X sin >> steq
     { "main" } axes
     'Y' autoscale draw
     << X cos 5 - >> steq
     { "auxiliary" } axes
     'Y' autoscale draw
     drax
     persist
 >>

draws two graphes in two differents axes systems (but only one is 
displayed). You have to use AXES to force auxiliary axes to be displayed.

ESSAI2
<<
     << X sin >> steq
     { "main" } axes
     'Y' autoscale draw
     << X cos 5 - >> steq
     { "auxiliary" } axes
     'Y' autoscale draw
     { "auxiliary" { "automatic" } { 0.5 } }  axes
     drax
     persist
 >>

You can use PMIN and PMAX, or SCALE too.

> - I must admit I don't understand anything about the AXES command. What
> do "(expression 1)" and "(expression 2)" in the HELP command refer to?
> 
> Here is my test-program:
> <<
>   deg
> 
>   WIREFRAME
> 
>   { 't' 0 360 } indep
> 
> #  'lat' depnd		# should this set the Y axis?
> # If the the line above is not commented, the following line gives
> # me with rpl-4.00pre8 version:
> # *** glibc detected *** double free or corruption (out): 0x0824df38 ***

	Possible, but you have to try the last beta release. It is up to date 
and pre8 is a little bit old... DEPND is the second variable (Y in some 
case) used to draw f(x,y).

>   { "test i" "test j" "test k" } label
>   "test titre" title
>   2 res
> 
>   << t Y
>     SIN *	/* Example */
>   >>
>   STEQ
> 
> # autoscale doesn't seem to work. For example, the t-axe is not
> # autoscaled from 0 to 360
> #  {} autoscale

	{} autoscale avoids all autoscale functions. You have to write { X Y Z 
} autoscale.

>   PPAR disp	/* Debugging purpose */
>   draw
>   persist

#!/usr/local/bin/rpl -cs

TEST
<<
     deg
     wireframe
     { 't' 0 360 } indep
     //{ 'Y' 0 360 } depnd <- with this line, I receive : *** glibc
     // detected *** free(): invalid pointer: 0x002f7670 ***
     // I suspect a bug in interprocess calls.
     { "test i" "test j" "test k" } label
     "test titre" title
     2 res

     << t Y SIN * >> STEQ

     { X Y Z } autoscale
     PPAR disp
     draw
     persist
 >>

>>	Why not ? If I understand, you would find a list like the
>>list you obtain with man rpl. I think it is possible without a lot of
>>work.
> 
> 
> Yes. This was what I meant.

	It's done in 4.00pre8q.

	Regards,

	JKB



Plus d'informations sur la liste de diffusion RPL2