Advertisement
sutasuu

Graph

Oct 14th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Asymptote 1.00 KB | Source Code | 0 0
  1. import geometry;
  2. import graph;
  3.  
  4. size(9cm, 0);
  5. defaultpen(fontsize(12pt));
  6. dotfactor = 4;
  7. picture axis;
  8.  
  9. real xmin = -5, xmax = 5,
  10.      ymin = -5, ymax = 5;
  11. xaxis(axis, xmin=xmin, xmax=xmax,
  12.     Ticks(scale(.7)*Label(align=E, Fill(white) ),
  13.           NoZero,
  14.           beginlabel=false, endlabel=false,
  15.           begin=false, end=false,
  16.           Step=0, step=0,
  17.           Size=0mm, size = 0mm),
  18.           Arrow(2mm),true);
  19.  
  20. yaxis(axis, ymin=ymin, ymax=ymax,
  21.     // Ticks(scale(.7)*Label(align=W, Fill(white) ),
  22.     //      NoZero,
  23.     //      beginlabel=false, endlabel=false,
  24.     //      begin=false, end=false,
  25.     //      Step=0, step=0,
  26.     //      Size=0mm, size = 0mm),
  27.           Arrow(2mm),true);
  28.  
  29. real a=2,b=-3,c=0;
  30. real f(real x){return a*x^2+b*x+c;}
  31. path Cf = graph(f, xmin, xmax, n = 400);
  32.  
  33. draw(Cf, linewidth(1pt));
  34.  
  35. label("$x$", (xmax,0), 2S);
  36. label("$y$", (0,ymax), 2W);
  37. //label(scale(.7)*"$0$", origin, S+W, UnFill);
  38. ylimits(ymin, ymax, Crop);
  39. add(axis);
  40. addMargins(2mm,2mm);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement