mpl_toolkits.clifford integrates with matplotlib, allowing you to use standard plotting workflows. This is useful when you need to combine geometric visualizations with other scientific plots.
Key usage details:
- Plotting: Use
plot(ax, [list_of_objects], ...) where ax is a matplotlib Axes object. - 2D Visualization: Use standard
plt.subplots(). - 3D Visualization: Use
plt.subplots(..., subplot_kw=dict(projection='3d')). - Styling: Supports standard matplotlib arguments like
color, label, marker, linestyle, linewidth, and markeredgewidth. - Limitations: Labels do not work for spheres in
mpl_toolkits.clifford. - Tip: Due to floating point rounding errors in
clifford.tools.classify, you may need to call .normal() on objects to ensure they render correctly.
from matplotlib import pyplot as plt
from mpl_toolkits.clifford import plot
fig, ax = plt.subplots()
plot(ax, [point, line, circle], color='tab:blue', label='objects')
plt.show()