Menu

#26 vector without arrowhead

closed-accepted
None
5
2003-12-22
2002-05-13
Gavin Salam
No

Would it be possible to have an additional style
like vector, except without the arrowhead (or
alternatively an option to vector that allows one to
set the arrowhead size to zero).

This would make it possible for a user to construct
arbitrary styles (e.g. I need errorbars which have
ticks part of the way up rather than at the
extremities, so as to indicate statistical errors as
opposed to total statistical+systematic errors, and
would construct this from a normal errorbar with a
"headless" vector extending vertically beyond the
normal errorbar).

Looking at the code, it seems like it would be fairly
painless to implement as a new style. But perhaps I'm
missing something and the facility is already
available?

Discussion

  • Hans-Bernhard Broeker

    Logged In: YES
    user_id=27517

    I'm not quite convinced such a style really would be useful.
    You can always achieve the same goal with a transformed
    datafile. I.e. for each headless vector, instead of a
    single line

    x1 y1 x2 y2
    

    you would have *three* lines in the datafile:

    --- begin ---
    x1 y1
    x2 y2

    --- end ----

    The blank line is important. Plot this 'with lines' and you
    get one line segment for each repetition of this pattern,
    from (x1,y1) to (x2, y2).

     
  • Gavin Salam

    Gavin Salam - 2002-05-14

    Logged In: YES
    user_id=543362

    Yes, I'm aware of the way of drawing obtaining
    segments with the "line" style and blank lines in
    the data file, though I hadn't thought of using it
    in this context.

    Having said that, if I want my data points to look
    (schematically) like the following

    y+yerr2
    |
    --- y+yerr1
    |
    * y
    |
    --- y-yerr1
    |
    y-yerr2

    x

    (widely used in some branches of physics, often
    also with asymmetric error bars, see
    e.g. http://arxiv.org/abs/hep-ex/0205026\), then
    it's necessary either

    . to have two separate data files, one for a
    normal "errorbar style" (x:y:yerr1) and a second
    one for all the line segments
    (x,y-yerr2:x,y+yerr2)

    or

    . play tricks with a single data file, e.g.

    --- begin ---
    x y yerr1 (y-yerr2)
    x y yerr1 (y+yerr2)

    --- end ---
    and then do
    > plot "file" u 1:2:3 w e, "file" u 1:4 w l

    in which case one can't e.g. then have (in the
    same datafile) joined lines going through all
    the data points (without grepping out the blank
    lines...)

    Both these approaches are perfectly feasible, but
    a little bit messy. So some other way of doing it
    (ideally without having to modify the datafile)
    would be nice. It doesn't necessarily have to be a
    vector without an arrowhead (I appreciate that
    introducing too many styles will just confuse
    people). Being able to set different widths for
    the tics in each plot command, instead of a global
    "set bars" option would be just as good.

    The (only ?) advantage of a headless vector is
    that it would make it possible to construct other
    more complex styles from combinations of gnuplot
    commands rather than having to write special
    datafiles (or bother the gnuplot developers :-)
    for each one.

     
  • Hans-Bernhard Broeker

    Logged In: YES
    user_id=27517

    For that particular purpose, I'd (ab)use the 'with
    boxxyerrorbars' style:

    set style line 1 lt 3 pt 5
    plot 'datafile' u 1:2:3 w err ls 1, \
         '' u 1:2:\(0\):4 w boxxyerr ls 1
    

    And as far as advantages by not haveing to doctor special
    datafiles for general line drawing usages --- I don't see
    any. The only difference would be whether you doctor based
    on datapoints or on series of datapoints. Actually, I'd say
    that 'with lines' and a properly doctored datafile would be
    preferrable, because you don't have to repeat datapoints in
    the file in order to connect them.

     
  • Gavin Salam

    Gavin Salam - 2002-05-15

    Logged In: YES
    user_id=543362

    The "abuse" of the 'with boxxyerrorbars' style is good
    enough!

    Thank you for your help.

     
  • Harald Harders

    Harald Harders - 2002-07-26

    Logged In: YES
    user_id=207272

    Now, there is a patch called "arrow styles via 'set style
    arrow'" which allows this directly:

    plot ... with vector nohead

    But you will need a current cvs version of gnuplot.

     
  • Ethan Merritt

    Ethan Merritt - 2003-12-22
    • assigned_to: nobody --> sfeam
    • status: open --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.