Nodes/ComfyUI-Data-Analysis/SNS Scatter Plot
ComfyUI Node

SNS Scatter Plot

Spot a correlation without leaving ComfyUI

By HowToSD·Created 2 years ago·Updated about a year ago· 23
SNS Scatter Plot
  • dataframe
  • IMAGE
x_column_name
y_column_name
title
x_axis_label
y_axis_label
legend_label
x_tick_as_intfalse
style
palette

A scatter plot is how you find out whether two columns actually move together, and SNS Scatter Plot lets you do that inside a ComfyUI graph instead of firing up a separate notebook. It's a Seaborn scatterplot wrapped as a node, fed by the DATAFRAME sockets that the HowToSD/ComfyUI-Data-Analysis pack moves around. Load a CSV, clean it with the pandas nodes, and drop this at the end of the chain to actually look at the data you've been munging.

The inputs that matter

Most of the fields are shared with its sibling SNS Line Plot, and they behave the same way:

  • x_column_name and y_column_name - the two columns you're comparing.
  • legend_label - comma-separated labels for the series.
  • x_tick_as_int - flip this when x is a year and Seaborn insists on drawing 2002.5 ticks instead of 2002.

The one thing that separates it from the line plot: multiple series. Put comma-separated columns in y_column_name and you get multiple scatter series on the same axes, which is how you fake a "hue" grouping without a categorical column - series A in one color, series B in another. style and palette take the standard Seaborn names (darkgrid/whitegrid/dark/white/ticks, and deep/muted/pastel/bright/dark/colorblind); leave them empty for defaults.

How it works

The node validates every column name you typed against the DataFrame's real columns, calls sns.scatterplot once per y series on a shared axes, then renders the figure to a PNG and converts it to a normalized float tensor. The output is an IMAGE - it drops into Save Image or any preview node exactly like a generated image. For a node whose whole job is "draw the dots," that round trip from matplotlib to a ComfyUI tensor is the neat bit; it's what lets plots live in the same graph as everything else.

Installing it

It ships in the ComfyUI-Data-Analysis pack, so you install the pack once. In ComfyUI Manager, search "Data analysis" and install ComfyUI-Data-Analysis, then restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git

Two README-level gotchas apply to every node in the pack: rename the cloned folder to data-analysis or the example workflows break (they reference that exact folder name), and expect real pip dependencies - pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml - none of which ship with stock ComfyUI. No GPU needed; Manager handles the packages, or run pip install -r requirements.txt yourself.

Troubleshooting

Column-name typos are the #1 failure here, and the pack is honest about them: you'll get a ValueError: Column 'X' not found in the DataFrame. rather than an empty chart. Throw a Pandas Show DataFrame node into the graph to see the exact names before you wire things up. And if the scatter looks like noise, remember it plots raw values - outliers will flatten the whole view, so consider a filter or a log transform from the pandas nodes before this one.

CategoryData Analysis

Inputs (10)

NameTypeDefaultDescription
dataframeDATAFRAME
x_column_nameSTRING
y_column_nameSTRING
titleSTRING
x_axis_labelSTRING
y_axis_labelSTRING
legend_labelSTRING
x_tick_as_intBOOLEANfalse
styleSTRING
paletteSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE