pm4py.vis.view_petri_net(petri_net: PetriNet, initial_marking: Optional[Marking] = None, final_marking: Optional[Marking] = None, format: str = 'png', bgcolor: str = 'white', decorations: Optional[Dict[Any, Any]] = None)[source]#

Views a (composite) Petri net

  • petri_net (PetriNet) – Petri net

  • initial_marking – Initial marking

  • final_marking – Final marking

  • format (str) – Format of the output picture (if html is provided, GraphvizJS is used to render the visualization in an HTML page)

  • bgcolor (str) – Background color of the visualization (default: white)

  • decorations – Decorations (color, label) associated to the elements of the Petri net

import pm4py

net, im, fm = pm4py.discover_petri_net_inductive(dataframe, activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp')
pm4py.view_petri_net(net, im, fm, format='svg')