Files

35 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
tags:
aliases:
date: 2024-11-10
time: 16:58:43
description:
---
**可以用來代替[Matplotlib](https://matplotlib.org/)**
Yes, `Matplotlib` is classic-its virtually the standard to go to when it comes to visualizing data in Python. But to be frank, it feels so much like trying to use an axe for delicate brain surgery, and its syntax? A little verbose, if were being honest. If youre not creating highly customized visualizations, there are better options with a more straightforward syntax.
## Why [Matplotlib](https://matplotlib.org/) is Overrated:
**Clunky syntax**: Even simple charts take an amazingly large number of lines to plot sometimes.
**Outdated default style:** The default style is configurable, but it isnt exactly inspiring-or, for that matter, particularly readable.
## What You Should Replace It With: Plotly
Where visualization cleanliness and interactivity matter, and definitely dont want a pile of code, `Plotly` is great. This is especially useful when you have to share visuals fast or within presentations on the web.
```python
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species")
fig.show()
```
With `Ploty`, you immediately get interactive graphs with great default visuals. The code is more concise and, by default, includes things like tooltips and zooming.
# 參考來源
- [5 Overrated Python Libraries (And What You Should Use Instead) | by Abdur Rahman | Nov, 2024 | Python in Plain English](https://python.plainenglish.io/5-overrated-python-libraries-and-what-you-should-use-instead-106bd9ded180)