Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1109 Cut-Off Arrow Heads

5.0
closed-fixed
nobody
None
5
2013-08-08
2012-04-02
Douglas
No

I often make vector plots, and one detail that annoys me is that often filled arrow heads are cut off at the end, so that they don't go to a point. I have attached an example that does this. One challenge is that setting lw 2 (or greater than one) causes wide lines to form the arrowhead. This means that to make visible vector plots, you have to select a wider line width, which gives you cut-off arrowheads. Also, when there are a variety of arrow lengths, arrow heads can be cut or not somewhat haphazardly. Is it possible to make them go to a point more consistently?

Thanks!

Discussion

1 2 > >> (Page 1 of 2)
  • Douglas
    Douglas
    2012-04-02

    Script to generate cut-off arrowheads

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-04-02

    I can't help in detail without more information, because

    1) Your example script requires a data file that is not provided.
    2) The attached png file is badly aliased, so it cannot be a screenshot of an *.eps file. Also it doesn't look like the output of the gnuplot png terminal. So how did you make this image?

    The line properties are in general terminal-specific. So you need to tell us what type of output you are aiming for. In PostScript and PDF, you might want to experiment with the linejoin terminal property, which you can change using, e.g.
    set term post {butt|round}

    Anyhow, if you want the arrow point to terminate exactly on a single pixel, then drawing it with thick lines simply won't work. How could it?

    I guess what you are really wanting is a way to set the width of the arrow shaft as if it were a filled rectangle drawn with thin lines rather than setting it as the width of a single thick line?

     
  • Douglas
    Douglas
    2012-04-02

    Ethan,

    You're right, I imagine variations in the terminal output have different results. Sorry about the non-included file -- 'tmp.txt' is identical to the data at the end. What you see is just an EPS output rasterized.

    I think you hit the nail on the head in your suggestion. I would like the lw property for vectors to ONLY affect the tail, not the head. We can adjust the head beautifully using the many arrow head options, so for the filled case, it's simply redundant to determine the lw of the head portion.

    It would seem at first to suffice to do two plots, one with thick lines and nohead, and another with lw 1 and filled heads. However, this is also problematic because the first plot terminates at the same point that the arrowhead terminates, making a new, even weirder looking arrowhead.

    Should we move this to a feature request, then? An option that allows me to control the lw of the head and the tail separately? Or, more easily, to have the default behavior use lw 1 for the head (but not the taill) whenever the filled option is chosen.

     
  • Ethan Merritt
    Ethan Merritt
    2012-04-02

    "What you see is just an EPS output rasterized."

    Strange. That looks really bad for *.eps output. I wonder if something else entirely has gone wrong. Here's what I get from running your script using the pdf terminal (attached).

     
  • Ethan Merritt
    Ethan Merritt
    2012-04-02

    same script sent through PDF terminal

     
    Attachments
  • Douglas
    Douglas
    2012-04-02

    Maybe this is a problem with eps? The rasterization isn't the problem. Check out the original eps I've attached (it's rotated, but still shows the cut-off arrowheads)

     
  • Ethan Merritt
    Ethan Merritt
    2012-04-16

    > I think you hit the nail on the head in your suggestion. I would like
    > the lw property for vectors to ONLY affect the tail, not the head.
    > We can adjust the head beautifully using the arrow head options

    So I tried this (apply the line width only to the shaft), and the result is really ugly. Some other approach is needed, at least if it's to be automated.

     
  • Douglas
    Douglas
    2012-04-16

    Hey Ethan, thanks for all your input on this! Could you show an example of what you're talking about? I deeply suspect this is some issue with just the EPS terminal. If the EPS examples could look more reliably like the PDF you showed, I'd be pretty happy. But I would also think flexibility in determining the shaft line properties separately from the head could only help, not hurt.

     
1 2 > >> (Page 1 of 2)