Python Customised Visualisation Workshop
Python Customised Visualisation Workshop
David Plummer
Right tool for the job
Algorithms
Python R
C#
KNIME C++
Java
Julia
Data Fortran
Speed
Evolution of KNIME visualisations
Extract
Transform Process Visualise
Load
Plotly
• Wide selection of charts
• Interactivity
• Customisable
• Chart types
• Themes
• Cross programming language
support
• Plotly Express
Example Customisation
Plotly concepts
Create Render
plotly express
Conda:
conda install –c conda-forge plotly python-kaleido
Note: Developer was a Plotly employee. They no longer work for Plotly, and the
package is not under active maintenance.
Python code - imports
Python code – plot chart
dictionary
key: pandas column name
value: display name
Default settings
• Could be passed as variables
Plotly object
Custom font
Background colour
Custom colours
Visualisation layout
Note:
title_font_size is shorthand in
plotly for nested dictionaries:
“title”: {
“font”: {
“size” : 24
}
}
Custom colour scheme
Dotted horizontal
gridline
Pickled Output:
Mechanism for serialising data
and sending it down the wire
Share code between nodes
Theme Component
Visualisation Component
Create a multi-line string containing the code
Note:
Security implications of executing arbitrary code!!
Do you trust the code you are executing.