fixed plotting isue with plot_f