How would you draw a black line with TikZ that shades to white/transparent radially (like this) between two coordinates?

Shading is possible for rectangles (TikZ documentation, Ch. 46), though I can not define the start and end coordinate as easily as with a line.

line shading radially

Update: Another approach was to create such an shaded rectangle was posted here.

  • 1
    You might benefit from the answer tex.stackexchange.com/questions/91689/… . May 11, 2013 at 9:22
  • 1
    This approach looks rather complicated for a seemingly easy task. Let's see what the community comes up with. May 11, 2013 at 9:47
  • 1
    Do you have only straight lines or it can have corners/curves in it? This is also a seemingly easy detail but a line is a pdf object with zero width no matter what kind of path is drawn over it. So it's not that straightforward. You might consider decorations for this.
    – percusse
    May 11, 2013 at 10:25
  • 1
    @percusse I want to draw lines for now but an extension for arcs would be nice (though is not absolutely necessary). Before asking I had a look at the decorations-documentation but could not find a suitable approach. May 11, 2013 at 10:43
  • 1
    How "fine" should the shading be? Would e.g. 5 steps be enough? May 11, 2013 at 10:46


Browse other questions tagged .