Menu

#2534 Documentation of "set xtics"

None
closed-cannot-reproduce
nobody
2022-07-27
2022-07-18
Anonymous
No

The keyword "add" seems to only make a difference if it is followed by an explicit list of tic positions in brackets, e.g.

    set xtics add (2.3,6,7,9.5)

I guess that's the intended behaviour? The help however says it can always be added:

set xtics
 ....
             {add}
             {  autofreq
                      | <incr>
                      | <start>, <incr> {,<end>}
                      | ({"<label>"} <pos> {<level>} {,{"<label>"}...) }

As this

 set xtics 4 add (-7,0,3,9)

actually works as expected, I guess the right syntax description should be

~~~
set xtics
....
{ autofreq
| <incr>
| <start>, <incr> {,<end>} }
{{add} ({"<label>"} <pos> {<level>} {,{"<label>"}...) }
~~~</label></level></pos></label></end></incr></start></incr>

Discussion

  • Ethan Merritt

    Ethan Merritt - 2022-07-18

    Cannot reproduce.
    For example the following sequence works for me:
    ~~~
    set xtics ("π" pi)
    set xtics add 0,2,6
    plot [0:6] sin(x)
    ~~~

    What gnuplot version are you using?
    What is the exact sequence of commands that is failing?

     
    • Karl Ratzsch

      Karl Ratzsch - 2022-07-18

      Hm, just gave it a try myself. You can (that's not clear from the docs, but I find it quite handy now) add a list of explicit tic positions to an invocation with an increment, in the same command.

      plot [0:6] sin(x)
      set xtics 2 add (1,0.6,3.9); rep
      

      You cannot add one incremental invocation to a previous one. They overwrite each other. That's not perfectly clear from the docs, but I don't know why I'd want to do it in the first place. ?

      set xtics 2; rep 
      set xtics add pi/2; rep # tics at 0,2,4,6 disappear
      

      You can add explicit tic positions to incremental tic positions, and vice versa

      set xtics 1; rep
      set xtics add (pi); rep
      set xtics add 0.6;rep
      

      , and you can always add more explicit tic positions to the already defined.

      set xtics add (2.3); rep
      

      Seems all in perfect working order.

       

      Last edit: Karl Ratzsch 2022-07-18
  • Ethan Merritt

    Ethan Merritt - 2022-07-27
    • status: open --> closed-cannot-reproduce
    • Group: -->
    • Priority: -->
     

Log in to post a comment.

MongoDB Logo MongoDB