# Gnuplot ranges: how to set

**URL:** <https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186>\
**Category:** General Usage\
**Created:** [February 10, 2022, 5:55pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186 "2022-02-10T17:55:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 10, 2022, 5:55pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186/1 "2022-02-10T17:55:07Z")

</div>

This one has got me stumped. When I don’t set the ranges explicitly, I get  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/1/f1c85dc7fce2e1ce06914b9aead257b05fd0afca.png)  
When I do, I get this:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/6/56f168f7ad238c37fe394915b1c80ca958438490.png)

The code:

```julia
        # 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))' " :-
        end

```

Any ideas, gnuplot fanatics?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [February 10, 2022, 6:22pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186/2 "2022-02-10T18:22:55Z")

</div>

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

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

```

?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 10, 2022, 6:24pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186/3 "2022-02-10T18:24:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 10, 2022, 6:36pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186/4 "2022-02-10T18:36:30Z")

</div>

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. ☹
