What is the foundational and most widely-used Python data visualization library, offering extensive control over plot elements?
Matplotlib. It is a low-level, highly customizable library for creating static, animated, and interactive 2D plots.
Which library, built on Matplotlib, simplifies the creation of aesthetically pleasing statistical graphics with less code and works well with pandas DataFrames?
Seaborn. It provides a high-level interface and built-in themes for creating complex visualizations like heatmaps and violin plots.
Which libraries are best for creating interactive, web-based visualizations and dashboards with features like hover tooltips and zoom?
Plotly and Bokeh. Plotly offers a wide range of 2D and 3D plots, while Bokeh specializes in high-performance streaming data visualizations for modern web browsers.
Matplotlib code example
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
Generate Sample Data
np.random.seed(0)
x = np.random.randn(100)
y = 2.5 * x + np.random.randn(100)
Create DataFrame
df = pd.DataFrame({'X': x, 'Y': y})
Plot Scatter with Matplotlib
plt.figure(figsize=(8, 4))
plt.title('Scatter Plot: X vs. Y')
plt.scatter('X', 'Y', data=df)
plt.xlabel('X')
plt.ylabel('Y')