Skip to content

Commit

Permalink
[add] matplotlib bar charts
Browse files Browse the repository at this point in the history
  • Loading branch information
windsuzu committed Mar 30, 2021
1 parent 0a6f7b1 commit 4e9fc1b
Show file tree
Hide file tree
Showing 4 changed files with 258 additions and 3 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ All skills are base on the implementation of Python 3.

# Table of contents

<!-- \[(.*)\]\((.*)\) -->
<!-- <li><a href="$2">$1</li> -->

<table>
<tr><th>Must Know</th><th>Classes</th><th>Functions</th></tr>
<tr>
Expand Down Expand Up @@ -187,6 +184,7 @@ All skills are base on the implementation of Python 3.
<li><a href="#line-plots-and-filling-area">Line Plots and Filling Area</li>
<li><a href="#time-series">Time Series</li>
<li><a href="#scatter-plots">Scatter Plots</li>
<li><a href="#bar-charts">Bar Charts</li>
</ul></td>
</table>

Expand Down Expand Up @@ -1991,6 +1989,32 @@ plt.tight_layout()

## Bar Charts

``` py
# Bar Charts
plt.bar(index - width, salary_all, width=0.25, label="All Devs")
plt.bar(index, salary_py, width=0.25, label="Python")
plt.bar(index + width, salary_js, width=0.25, label="JavaScript")
plt.xticks(ticks=index, labels=ages)

plt.title("Median Salary (USD) by Age")
plt.xlabel("Ages")
plt.ylabel("Median Salary (USD)")
plt.legend()
plt.tight_layout()


# Horizontal Bar Charts
plt.barh(language, popularity)
plt.title("Most Popular Languages")
plt.xlabel("Number of People Who Use")
plt.tight_layout()
```

![](assets/matplotlib/bar_charts.jpg)
![](assets/matplotlib/horizontal_bar_charts.jpg)

- [Details 🔥](matplotlib/bar_charts.ipynb)

## Pie Charts

## Histograms
Expand All @@ -1999,6 +2023,8 @@ plt.tight_layout()

## Image

## Correlation Heatmap

# TODOs

| TODOs |
Expand Down
Binary file added assets/matplotlib/bar_charts.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/matplotlib/horizontal_bar_charts.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4e9fc1b

Please sign in to comment.