How the `Canvas` class works
masterThe Canvas class is the underlying engine for all plotting. It manages a grid of characters where each character can contain up to 2x4 Braille dots.
Coordinate Systems:
- Reference System: You plot using arbitrary coordinates defined by
xmin,ymin,xmax, andymax. - Discrete System: The canvas internally maps these to a dot-based grid.
All plotting methods (point, line, rect, text, etc.) use the Reference System.
import plotille
# Initialize a canvas with a specific reference area
cv = plotille.Canvas(width=40, height=20, xmin=0, ymin=0, xmax=1, ymax=1)
# Plot using reference coordinates
cv.rect(0.1, 0.1, 0.6, 0.6)
print(cv.plot())