Advertisement
sutasuu

graph2

Oct 15th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Asymptote 1.03 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 f(real x){
  30.   return (x^3 + 4)/x^2;
  31. }
  32. path Cf1 = graph(f, xmin, -0.1, n = 400);
  33. path Cf2 = graph(f, 0.1, xmax, n = 400);
  34. draw(Cf1^^Cf2,green+1pt);
  35.  
  36. label("$x$", (xmax,0), 2S);
  37. label("$y$", (0,ymax), 2W);
  38. //label(scale(.7)*"$0$", origin, S+W, UnFill);
  39. ylimits(ymin, ymax, Crop);
  40. add(axis);
  41. addMargins(2mm,2mm);
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement