2D plot function