Is there any node to write a Python Script to output visualization?

Hi,
I would like to know if there is any functionality where we can execute a Python script which takes input data and provides a output containing visualization. The node is pretty similar to plotly visualization nodes but instead is it possible to write custom code in Python script node and get a graph as output?

For example, input a data table to a node containing custom python code to create a bar graph and this graph can be output of the node?

@vipul

How about the Python View node?
gr. Hans

7 Likes

Here are a few examples of some graphics in python and exported from KNIME.

4 Likes

Hi @mlauber71 @HansS,

Thank you so much for sharing this. I actually got it working for basic things.
However, when I was trying to build a histogram, I’m able to see it when I execute the script and click ‘Show Image’, but I entirely different image when I execute the node and view the Output image. I think I’m making some mistake while saving it in the buffer.

I tried using StringIO from io package but then I get ‘No Image generated’.

‘Show Image’ output:

Node- Output Image:

Regards,
Vipul

1 Like

Could you provide us with an example that reproduces the error?

Hi,
There isn’t any error as such. It’s just the script execution results in a correct histogram. However, when I execute the node it gives a different output image like in the screenshot.
I’m not sure where I’m going wrong.

Regards,
Vipul

Hi there @vipul,

have you managed to figure it out or still need help?

Br,
Ivan

Hi @ipazin,
I just checked and it’s working okay now. Although, I didn’t change anything but just seems to work now.

Thank you for all the help.

Regards,
Vipul

1 Like

Hi there,

glad to hear that :slight_smile:

Br,
Ivan

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.