Gnuplot ranges: how to set

This one has got me stumped. When I don’t set the ranges explicitly, I get
When I do, I get this:

The code:

        # comment out the following two lines NOT to set the range explicitly
        @gp  :- "set xrange [0:0.001] " :-
        @gp  :- "set yrange [-1.1e-5:1.1e-5] " :-
        for (i, k) in enumerate(["C"])
            @gp  :-  collect(0.0:dt:(nsteps*dt))./phun("milli*s") pointvelocities[k]./phun("mm/s") " lw 2 lc rgb '$color' with lines title 'Velocity at $(string(k))' "  :-

Any ideas, gnuplot fanatics?

I can’t see the problem?
Your xrange is only from 0 to 0.001 which is where y is 0.0, perhaps you meant

@gp  :- "set xrange [0:1] " :-


Oh my, I forgot to set the milliseconds. Silly me…

1 Like

Having a second pair of eyeballs on the code is priceless. That’s why I always liked “extreme programming”! But sometimes you just have to go it alone. It usually ends up being more work, since one makes silly mistakes like this which take a long time to figure out. :frowning:

1 Like