Python Plot

The node executes Python code. There are two ways to configure which code will be executed:

  1. Select (Templates Tab; double-click or "Use this template") and configure a Python template from the template repository.
  2. Write you own Python code (Script Editor Tab)

The Python installation which is used for execution can be set in the Preferences under KNIME > Community Scripting > Python Scripting. The settings allow to switch between a Python2 and Python3 installation. They further provide to set template resources (URLs or file locations) for either plot and snippet respectively.

Further, the node can be executed in an 'Open External' mode (checkbox at the Script Editor Tab) which then would push the KNIME data to Python for troubleshooting or prototyping (either as a Jupyter notebook or via command line).

For detailed information check out the Wiki Page

Options

Templates

Templates/Refresh
Loads again the template file(s).
Templates/Gallery
Generate a temporary webpage shown in a browser which gives an overview about all available templates.
Templates/Description,Source
Description explains what this snippet does. Source displays the RGG script.
Templates/Use this template
Click to load the GUI (or double-click onto the template)

Script Editor

Open external
If checked, Python will be opened externally, either as Jupyter notebook or via command line.
Scipt Editor/Unlink from Template
Gives access to the Python script after adaptation by the GUI.
Scipt Editor/Edit Template
Gives access to the RGG script to adapt the GUI of a template.

Output Options

File Type
If the image is saved as a file, it is saved with the given file format
Width, Height
Width and height of the plot view in pixels, which is also used when the images is saved as a file.
DPI
If the image is saved as a file, the image is created with the given resolution
Selected File
Set the file name to save the plot as an image.
The following place holders are supported:
  • $$DATE$$ for the current date,
  • $$USER$$ for the user name,
  • $$WS$$ for the workspace directory, and
  • FLOWVAR(variable name) to use flow variable values in the file name.
If this field is empty, no file will be created
Write image to file
If unchecked, no file export is generated; only the node view
Overwrite existing file
If checked, existing files will be overwritten
If unchecked, an error will be thrown if the file already exists

Input Ports

Icon
A data table
Provided as pandas data frame named kIn in Python.

Output Ports

Icon
The generated Python plot as image (png)

Views

Python plot
The generated Python plot (png). The view be can be rescaled and recreated by double-clicking.

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.