Spaces:
Sleeping
Sleeping
Commit
·
a6ef4e5
1
Parent(s):
39e69d0
Update app.py
Browse files
app.py
CHANGED
@@ -13,13 +13,17 @@ def plot_forecast(final_year, companies, noise, show_legend, point_style):
|
|
13 |
plt_format = ({"cross": "X", "line": "-", "circle": "o--"})[point_style]
|
14 |
fig = plt.figure()
|
15 |
ax = fig.add_subplot(111)
|
16 |
-
for i, company in enumerate(
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
if show_legend:
|
22 |
-
plt.legend(
|
|
|
|
|
|
|
23 |
return fig
|
24 |
|
25 |
|
|
|
13 |
plt_format = ({"cross": "X", "line": "-", "circle": "o--"})[point_style]
|
14 |
fig = plt.figure()
|
15 |
ax = fig.add_subplot(111)
|
16 |
+
for i, company in enumerate(["Google", "Microsoft", "Gradio", "Apple", "Amazon", "Facebook"]):
|
17 |
+
if company in companies:
|
18 |
+
series = np.arange(0, year_count, dtype=float)
|
19 |
+
series = series**2 * (i + 1)
|
20 |
+
series += np.random.rand(year_count) * noise
|
21 |
+
ax.plot(x, series, plt_format, label=company)
|
22 |
if show_legend:
|
23 |
+
plt.legend()
|
24 |
+
ax.set_xlabel("Year")
|
25 |
+
ax.set_ylabel("Revenue")
|
26 |
+
ax.set_title("Revenue Forecast for Selected Companies")
|
27 |
return fig
|
28 |
|
29 |
|