# Plots: adding to plot doesn't preserve series style

**URL:** <https://discourse.julialang.org/t/plots-adding-to-plot-doesnt-preserve-series-style/23417>\
**Category:** Visualization\
**Created:** [April 22, 2019, 6:41pm UTC](https://discourse.julialang.org/t/plots-adding-to-plot-doesnt-preserve-series-style/23417 "2019-04-22T18:41:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeteS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petes/32/8111_2.png) [@PeteS](https://discourse.julialang.org/u/PeteS)\
**Post date:** [April 22, 2019, 6:41pm UTC](https://discourse.julialang.org/t/plots-adding-to-plot-doesnt-preserve-series-style/23417/1 "2019-04-22T18:41:46Z")

</div>

Hello, new to Julia so I may have missed something here. I’m creating a line plot, setting the style as step, then adding points in a loop … to mimic the output of a simulation. When the points are added the style reverts to the normal. Latest packages in JuliaPro/Atom. Any suggestions?

Also, while I’m here, any suggestions on how to make this faster? It’s about 9 s to add the points, so about 100 ms an iteration, love it to be 10x faster!

```julia
# Initial plot, steps style
using Plots
gr()
x = 0:10
y = rand(11)
plt = plot(x, y, seriestype = :steppost,
                 legend=false)
xlims!((0,100))
ylims!((0,1))
display(plt)

# Add to plot, reverts to normal style
function AddToPlot()
    for i = 11:100
        push!(plt, 1, i*1.0, rand())
        display(plt)
    end
end
@time AddToPlot()

```
