when i call this function to plot the result i have this erorr: NameError: global name 'plot2d' is not defined