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

Saves a Petri net visualization to a file

  • petri_net (PetriNet) – Petri net

  • initial_marking (Marking) – Initial marking

  • final_marking (Marking) – Final marking

  • file_path (str) – Destination path

  • 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.save_vis_petri_net(net, im, fm, 'petri_net.png')