Page 1 sur 1

Modifier le style de la routine dot

Posté : jeu. 10 mai 2012, 11:28
par Fabrice
Bonjour,
Dans le code ci-après, faut-il ruser pour avoir des croix au lieu des points ?

Figure asymptote 88a197ef74432b83df1d27bd30960153
*** Pour masquer/découvrir le code Asymptote qui a permis de créer la figure, il faut cliquer dessus. ;-) ***

CODE ASYMPTOTE de la figure ci-dessus : Tout sélectionner
  1. import graph;
  2. usepackage("mathrsfs,esvect,fourier");
  3. arrowhead guillaumetellHead=HookHead(dir=10);
  4. guillaumetellHead.size=new real(pen p)
  5. {
  6. static real hcoef=5;
  7. return hcoef*arrowtexfactor*linewidth(p);
  8. };
  9. arrowbar guillaumetell=Arrow(guillaumetellHead);
  10. unitsize(1cm,0.04cm);
  11. xlimits(1989,1996);
  12. ylimits(400,625);
  13. real x[]={1990,1991,1992,1993,1994,1995};
  14. real y[]={445.5,474.5,504.8,530.2,568.2,588.5};
  15. for (int i=0; i<6; ++i){
  16. dot((x[i],y[i]));
  17. }
  18. pen ptick=gray(0.9);
  19. pen pTick=gray(0.7);
  20. pen p=fontsize(8pt);
  21. xaxis(BottomTop,pTick,LeftTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=1,step=1));
  22. yaxis(LeftRight,ptick,RightTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=25,step=5));
  23. xequals(1989,400,625,p+0.8bp+black,LeftTicks(Size=2,size=0,end=false,endlabel=false,Step=25,ptick=invisible),guillaumetell);
  24. yequals(400,1989,1996,p+0.8bp+black,RightTicks(Size=2,size=0,end=false,endlabel=false,Step=1,ptick=invisible),guillaumetell);
  25. label("A",(1990,445.5),S+2W,p);
  26. label("B",(1995,588.5),N+2E,p);

Merci.

Re: Modifier le style de la routine dot

Posté : jeu. 10 mai 2012, 12:33
par GM

Figure asymptote 77934b4c9e13b099b6399da5328394be
*** Pour masquer/découvrir le code Asymptote qui a permis de créer la figure, il faut cliquer dessus. ;-) ***

CODE ASYMPTOTE de la figure ci-dessus : Tout sélectionner
  1. import graph;
  2. usepackage("mathrsfs,esvect,fourier");
  3. arrowhead guillaumetellHead=HookHead(dir=10);
  4. guillaumetellHead.size=new real(pen p)
  5. {
  6. static real hcoef=5;
  7. return hcoef*arrowtexfactor*linewidth(p);
  8. };
  9. arrowbar guillaumetell=Arrow(guillaumetellHead);
  10. unitsize(1cm,0.04cm);
  11. xlimits(1989,1996);
  12. ylimits(400,625);
  13. real x[]={1990,1991,1992,1993,1994,1995};
  14. real y[]={445.5,474.5,504.8,530.2,568.2,588.5};
  15. marker croix=marker(scale(2)*rotate(45)*cross(4),1bp+red);
  16. for (int i=0; i<6; ++i){
  17. draw((x[i],y[i]),croix);
  18. }
  19. pen ptick=gray(0.9);
  20. pen pTick=gray(0.7);
  21. pen p=fontsize(8pt);
  22. xaxis(BottomTop,pTick,LeftTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=1,step=1));
  23. yaxis(LeftRight,ptick,RightTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=25,step=5));
  24. xequals(1989,400,625,p+0.8bp+black,LeftTicks(Size=2,size=0,end=false,endlabel=false,Step=25,ptick=invisible),guillaumetell);
  25. yequals(400,1989,1996,p+0.8bp+black,RightTicks(Size=2,size=0,end=false,endlabel=false,Step=1,ptick=invisible),guillaumetell);
  26. label("A",(1990,445.5),S+2W,p);
  27. label("B",(1995,588.5),N+2E,p);


;-)

ou si tu préfères plus original :

Figure asymptote 485f33c4804daedb85ac2311567f5a00
*** Pour masquer/découvrir le code Asymptote qui a permis de créer la figure, il faut cliquer dessus. ;-) ***

CODE ASYMPTOTE de la figure ci-dessus : Tout sélectionner
  1. import graph;
  2. usepackage("mathrsfs,esvect,fourier");
  3. arrowhead guillaumetellHead=HookHead(dir=10);
  4. guillaumetellHead.size=new real(pen p)
  5. {
  6. static real hcoef=5;
  7. return hcoef*arrowtexfactor*linewidth(p);
  8. };
  9. arrowbar guillaumetell=Arrow(guillaumetellHead);
  10. unitsize(1cm,0.04cm);
  11. xlimits(1989,1996);
  12. ylimits(400,625);
  13. real x[]={1990,1991,1992,1993,1994,1995};
  14. real y[]={445.5,474.5,504.8,530.2,568.2,588.5};
  15. marker croix=marker(scale(4)*cross(7),2bp+blue);
  16. for (int i=0; i<6; ++i){
  17. draw((x[i],y[i]),croix);
  18. }
  19. pen ptick=gray(0.9);
  20. pen pTick=gray(0.7);
  21. pen p=fontsize(8pt);
  22. xaxis(BottomTop,pTick,LeftTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=1,step=1));
  23. yaxis(LeftRight,ptick,RightTicks("%",extend =true,ptick=ptick,pTick=pTick,Step=25,step=5));
  24. xequals(1989,400,625,p+0.8bp+black,LeftTicks(Size=2,size=0,end=false,endlabel=false,Step=25,ptick=invisible),guillaumetell);
  25. yequals(400,1989,1996,p+0.8bp+black,RightTicks(Size=2,size=0,end=false,endlabel=false,Step=1,ptick=invisible),guillaumetell);
  26. label("A",(1990,445.5),S+2W,p);
  27. label("B",(1995,588.5),N+2E,p);


:mrgreen:

Re: Modifier le style de la routine dot

Posté : jeu. 10 mai 2012, 13:38
par Fabrice
Salut,
Comme d'habitude, réponse rapide et efficace.
Merci beaucoup.