plot function update