[Chennaipy] Chennaipy - Monday Module - 19 Sep 2022

selvi dct selvi.dct at gmail.com
Mon Sep 19 13:55:39 EDT 2022


Date: 19 Sep 2022


Module : matplotlib


Installation : pip install matplotlib


About:

Matplotlib produces publication-quality figures in a variety of hardcopy
formats and interactive environments across platforms.


Source Code:

import matplotlib.pyplot as plt


fig, ax = plt.subplots()


fruits = ['apple', 'blueberry', 'cherry', 'orange']

counts = [40, 100, 30, 55]

bar_labels = ['red', 'blue', '_red', 'orange']

bar_colors = ['tab:red', 'tab:blue', 'tab:red', 'tab:orange']


ax.bar(fruits, counts, label=bar_labels, color=bar_colors)


ax.set_ylabel('fruit supply')

ax.set_title('Fruit supply by kind and color')

ax.legend(title='Fruit color')


plt.show()


Reference:

https://pypi.org/project/matplotlib/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/chennaipy/attachments/20220919/a7e0cf74/attachment.html>


More information about the Chennaipy mailing list