This is simpler : use the option xtics directly in draw2d :
load(draw)$
xt : setify(makelist([concat(string(i/4*pi)),ev(i/4*%pi,numer)],i,-6,6))$
draw2d(xtics = xt,
explicit(sin(x),x,-5,5) )$
reyssat a ?crit :
> J. Simons a ?crit :
>
>> L.S.,
>>
>> How can Maxima produce a sinusgraph with a graduation-scale
>> consisting of rational multiples of %pi (see attachment).
>>
> I don't see any attachment, but you may try using draw2d with
> user_preamble. For instance :
>
> (%i1) load(draw)$
> (%i2) p:"set xtics (\"-pi\" -3.14, \"0\" 0, \"pi\" 3.14)";
> (%o2) set xtics ("-pi" -3.14, "0" 0, "pi" 3.14)
> (%i3) draw2d(explicit(sin(x)-1,x,-5,5),
> user_preamble=p);
>
> of course you may want to "compute" the preamble. This is an attempt
> (probably not very clean) :
> (%i4) p:concat("set xtics(")$
> for i:-5 thru 5 do (v:string(i/4*pi), p:concat(p,\",v,\","
> ",string(ev(i/4*%pi,numer))), if i<5 then p:concat(p,","))$
> p:concat(p,")")$
> (%i6)
> (%i7) draw2d(explicit(sin(x)-1,x,-5,5),
> user_preamble=p);
>
> Eric Reyssat
>
>
>>
>> Thanking you in advance for your answer.
>>
>> Regards,
>>
>> Jos? Simons
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>