work with plot function