7

This question already has an answer here:

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.

marked as duplicate by Tom Bombadil, Thorsten, Martin Schröder, Claudio Fiandrino, Kurt May 11 '13 at 14:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    You might benefit from the answer tex.stackexchange.com/questions/91689/… . – Christian Feuersänger May 11 '13 at 9:22
  • 1
    This approach looks rather complicated for a seemingly easy task. Let's see what the community comes up with. – Peter Pablo May 11 '13 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 '13 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. – Peter Pablo May 11 '13 at 10:43
  • 1
    How "fine" should the shading be? Would e.g. 5 steps be enough? – Tom Bombadil May 11 '13 at 10:46

Browse other questions tagged or ask your own question.