Reputation: 355
I have a code workbook in which I create several plots using Matplotib:
If I run all downstream from my data-dataset the plots are not shown at the expected node, sometimes they do not contain any plots and sometimes some of the nodes contain more than one visualization.
Upvotes: 0
Views: 74
Reputation: 355
This is happening because matplotlib is not thread safe.
By adding @synchronous_node_execution
to each of the plot_-code workbook nodes, you can lock each node to ensure the visualization is shown on the correct node:
# plot 1
import matplotlib.pyplot as plt
@synchronous_node_execution
def plot_1(data):
df = data
[...]
Upvotes: 0