Lar159 commited on
Commit
01dfac2
·
verified ·
1 Parent(s): 716229c

Update tools/parabola_plotter_tool.py

Browse files
Files changed (1) hide show
  1. tools/parabola_plotter_tool.py +3 -1
tools/parabola_plotter_tool.py CHANGED
@@ -21,6 +21,8 @@ def plot_parabola_graph(a: float, b: float, c: float) -> str:
21
  try:
22
  # Cria uma gama de valores para x
23
  x = np.arange(-10, 11, 2)
 
 
24
 
25
  # Calcula y usando a fórmula da função quadrática
26
  y = a * x**2 + b * x + c
@@ -31,7 +33,7 @@ def plot_parabola_graph(a: float, b: float, c: float) -> str:
31
  # Configura e cria o gráfico
32
  plt.figure(figsize=(8, 6))
33
  plt.plot(x, y)
34
-
35
  plt.title(f"Gráfico da Parábola")
36
  plt.xlabel("x")
37
  plt.ylabel("y")
 
21
  try:
22
  # Cria uma gama de valores para x
23
  x = np.arange(-10, 11, 2)
24
+ y_min, y_max = y.min(), y.max()
25
+
26
 
27
  # Calcula y usando a fórmula da função quadrática
28
  y = a * x**2 + b * x + c
 
33
  # Configura e cria o gráfico
34
  plt.figure(figsize=(8, 6))
35
  plt.plot(x, y)
36
+ plt.ylim(y_min-1, y_max+1)
37
  plt.title(f"Gráfico da Parábola")
38
  plt.xlabel("x")
39
  plt.ylabel("y")