Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lnugraha authored May 31, 2024
1 parent f2eaa2c commit 7302902
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,36 @@ def main():
</details>

<b> 3. Plotting Regression Line </b>
<details>

<summary> Using <b>List of Dictionary</b> (snow_plot.py) </summary>

```python
from matplotlib import pyplot as plt

snow_yield_dictionary =
[{"Snow":
[23.1, 32.8, 31.8, 32.0, 30.4, 24.0, 39.5, 24.2, 52.5, 37.9, 30.5, 25.1, 12.4, 35.1, 31.5, 21.1, 27.6]
},
{"Yield":
[10.5, 16.7, 18.2, 17.0, 16.3, 10.5, 23.1, 12.4, 24.9, 22.8, 14.1, 12.9, 8.8, 17.4, 14.9, 10.5, 16.1]
}]

def plot_the_curve():
snow_dictionary = snow_yield_dictionary[0]
yield_dictionary = snow_yield_dictionary[1]

snow_list = snow_dictionary["Snow"]
yield_list = yield_dictionary["Yield"]

plt.title("Plot of Snow vs Yield"); plt.xlabel("Snow"); plt.ylabel("Yield")
plt.scatter(snow_list, yield_list, c='blue', marker='H')
plt.show()
plt.savefig('plot_of_snow_vs_yield.png')

def main():
plot_the_curve()

```

</details>

0 comments on commit 7302902

Please sign in to comment.