Hello,
I have a numerical data set from a parameter space sweep based on simulation results.
Some columns are ‘input parameters’ for the simulation, while others are ‘result fields’.
I want to create a scatter plot for each group of a set of parameters with a legend referring to the parameternames and values.
I need to be able to change both parameters and fields easily and without having to make many adjustments.
Here is a little demo of what i already tried to achieve:
Group_plot_attempt.knwf (60.2 KB)
Thank you in advance,
Chris
@MagnoChris
You can simplify this significantly, no loop is needed
I suggest using a Color Manager node followed by the Scatter Plot view.
- Color Manager: Assign colors to your “Parameter” column here.
- Scatter Plot: Connect the data here. In the configuration, select your “Parameter” column for the Color dimension.
This will create a single chart with 4 color-coded groups and a legend.
Example workflow: Group_plot_attempt – KNIME Community Hub
3 Likes
Hi @k10shetty1, thanks dor your reply. Things are a little bit more complicated when i have a parameter sweep where e.g. param1, param2 and param3 have been changed and i want a scatter plot similar to what you have shown but with one color for each unique comination of param1, param2 and param3. This is a common task that i have to perform very frequently and i have developed my own solutions to this - basically a python node - but i wonder that KNIME doesn’t support native solutions to this.
@MagnoChris If that is the case, you can solve this dynamically using the Expression node.
Simply create a new column that joins all parameter columns into a single group identifier. For example, for two-parameter columns, you can use:
join(“_”, $[“Parameter_1”], $[“param_2”])
Assign this result to a new column (e.g., grouped), then:
- Use this new column in the Color Manager to assign colors.
- Select the same column as the color column in your Scatter Plot.
This way, each unique parameter combination automatically gets its own color, and it works even if the parameter values change between runs.
I’ve also updated my workflow accordingly, you can find it here: Group_plot_attempt – KNIME Community Hub
1 Like
@MagnoChris graphics can become quite complicated. My take would be to come up with your specific version and let an LLM create a Python code that would have the variable elements as KNIME Flow variables that you can then set via KNIME components.
That way you combine the power of Python graphic packages like Seaborn or Matplotlib (which are integrated in KNIME’s Python extension) and the comfort of Low Code KNIME workflows.
Blog: “KNIME and Python Graphics — Another Collection of Examples”