Nodes/comfyui_cv/CV Draw Plot Frame
ComfyUI Node

CV Draw Plot Frame

Puts a grid, ticks labelled in WORLD units and a scale bar under a 2D plot - the axes that turn a drawn path or point cloud into a readable figure. Without them a trajectory is a squiggle with no size: you cannot tell a 3 metre wobble from a 300 metre one. Feed it the SAME world points and margin you gave 'CV Fit Points To Box' (via 'extent_from', or as explicit min/max) and it reproduces that node's mapping exactly, so a tick at 50 m lands where the point at 50 m lands. Draw this FIRST, then the data on top. Nothing here reads the data itself, so it also works as an empty graticule.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Draw Plot Frame
  • source
  • extent_from
  • image
x_min0.00
x_max100.00
y_min0.00
y_max100.00
margin20
grid_x6
grid_y6
y_axisy down (pixel rows)
unitsm
x_labelx
y_labelz
scale_barbottom-left
color(200, 200, 200)
grid_color(70, 70, 70)
Categoryimage/CV/points

Inputs (16)

NameTypeDefaultDescription
sourceCOMFY_MATCHTYPE_V3Canvas to draw on (a copy is made) - e.g. 'OpenCV Constant Like'. Its size sets the plot box. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
x_minFLOAT0.00-1000000000–1000000000World range, used only when 'extent_from' is empty.
x_maxFLOAT100.00-1000000000–1000000000
y_minFLOAT0.00-1000000000–1000000000
y_maxFLOAT100.00-1000000000–1000000000
marginINT200–4096Must MATCH the margin given to 'CV Fit Points To Box', or the grid and the data disagree.
grid_xINT60–64Roughly how many vertical grid lines to aim for; the actual step is rounded to a 1 / 2 / 5 x 10^k value so the labels stay round numbers. 0 = no grid.
grid_yINT60–64Same for horizontal grid lines.
y_axisCOMBOy down (pixel rows)Which way the second coordinate grows. Points that came through 'Fit Points To Box' are already in PIXEL rows (y grows downward) - that is the default. Choose 'y up (world)' only if you flipped them yourself.
unitsSTRINGmUnit suffix on the tick labels and the scale bar ('m', 'px', 'mm'...). Empty for bare numbers.
x_labelSTRINGxAxis name drawn at the bottom right. Empty = none.
y_labelSTRINGzAxis name drawn at the top left. Empty = none. For a top-down ('XZ') view of a trajectory this is z.
scale_barCOMBObottom-leftA labelled bar of known world length. It is the one annotation that still says how big the picture is after someone crops or rescales the image.
colorSTRING(200, 200, 200)Colour of the ticks, labels, border and scale bar.
grid_colorSTRING(70, 70, 70)Colour of the grid lines - keep it well below the data's contrast so the grid stays behind it.
extent_fromoptNPARRAYWorld points, Nx2, whose bounding box defines the plotted range - pass the same array you gave 'Fit Points To Box' (both tracks concatenated, if you are overlaying two). When absent the explicit min/max below are used.

Outputs (1)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3Same format as the image input.