Download Stack/Stack_4a9f7debce768a42/code.py from AIHero123/ChartM3: direct link, hf CLI and curl.
- Browser
- Download file 621 Bytes
-
https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_4a9f7debce768a42/code.py
- Command line
-
hf download hf://datasets/AIHero123/ChartM3/Stack/Stack_4a9f7debce768a42/code.py
-
curl -L -o code.py https://huggingface.co/datasets/AIHero123/ChartM3/resolve/main/Stack/Stack_4a9f7debce768a42/code.py
621 Bytes
| import matplotlib.pyplot as plt | |
| # Months | |
| months = [1, 2, 3, 4, 5, 6] | |
| # Sales data | |
| strategyA = [50000, 55000, 60000, 65000, 70000, 75000] | |
| strategyB = [45000, 50000, 55000, 60000, 65000, 70000] | |
| strategyC = [35000, 40000, 45000, 50000, 55000, 60000] | |
| plt.figure(figsize=(10,7)) | |
| plt.stackplot(months, strategyA, strategyB, strategyC, colors=['blue', 'green', 'purple'], labels=['Strategy A','Strategy B', 'Strategy C']) | |
| plt.title('Effectiveness of Different Marketing Strategies') | |
| plt.xlabel('Months') | |
| plt.ylabel('Sales in $') | |
| # Adding legend | |
| plt.legend(loc='upper left') | |
| plt.tight_layout() | |
| plt.savefig("figure.png") |