Easy Data Visualization
py_simple.easy_data_visualization
easy_data_visualization aims to simplify data visualization. without requiring users to memorize every chart type or matplotlib function.
plot_data(X, Y=None)
Infers the type of the given data (quantitative or categorical) and automatically plots the most appropriate chart(s) for it, handling the chart-type selection, axis setup, and matplotlib boilerplate every data visualization needs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
list
|
The primary data series to plot. |
required |
Y
|
list
|
A second data series to plot against |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
None |
The chart(s) are rendered directly via |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the inferred type combination of |
ValueError
|
If |
Example
from py_simple import plot_data
plot_data([1, 2, 2, 3, 5, 5, 5, 8])
import matplotlib.pyplot as plt
data = [1, 2, 2, 3, 5, 5, 5, 8]
fig, ax = plt.subplots()
ax.hist(data)
ax.set_title("Histogram")
ax.spines[['top', 'right']].set_visible(False)
plt.show()