Consider the following:




%   \psset{linestyle=none}


How do I fill the five circles with a gradient color that stretches over all five of them, starting with orange at the left and going to green at the right?

I would like to remove the circles themselves (therefore linestyle=none) but fill the inner of them, as explained.

  • Do you want to fill each individual circle with a gradient, or should the gradient stretch over the total width of the five circles? – Jake Mar 21 '13 at 16:26
  • The gradient should strech over all five circles. (I'll specify it in my question.) – Svend Tveskæg Mar 21 '13 at 16:28
  • If you can construct the outline of the Audi logo then you can use a clip a gradient rectangle with that. – percusse Mar 21 '13 at 16:32
  • What does the Audi logo has to do with it? :( I would just like to have a gradient fill of the five circles. – Svend Tveskæg Mar 21 '13 at 16:35
  • @SvendMortensen Think of the five circles combined as in Jake's answer. The outline of five circles I mean. Well Audi logo + one more circle. :) – percusse Mar 21 '13 at 16:40

     \multido{\rA=-8+4}{5}{\pscircle(\rA ex,0){3ex}}}


enter image description here

and the same for a gradmidpoint=0.5

enter image description here

enter image description here

  • @SvendMortensen: There is also pst-slpe that provides fillstyle=slope (and friends). – Werner Mar 21 '13 at 17:34
  • @Werner Nice. I'll probably use this. – Svend Tveskæg Mar 21 '13 at 18:04

Here's how you can do it using TikZ: The filling will stretch over all circles as long as they're specified using a single \path (or \shade) command




\shade [left color=orange!90!red, right color=green!80!orange]
    \foreach \i in {-2,...,2}{
     (\i*3.5ex,0) circle [radius=2.5ex]
\node [font=\bfseries] (A) {Springboldene};

  • Nice. I would like to use PSTricks, though. – Svend Tveskæg Mar 21 '13 at 16:38
  • 3
    @SvendMortensen: Yes, sorry, your question is quite clear about that. It has just become customary that TikZ questions also get a PSTricks answer, and vice versa. I'm sure Herbert or KarlsStudents will come up with a PSTricks approach soon. – Jake Mar 21 '13 at 16:40
  • Have you pinged any of them? :) – Svend Tveskæg Mar 21 '13 at 16:43
  • @SvendMortensen: There's no global ping, unfortunately, but I think they monitor the {pstricks} tag quite closely. – Jake Mar 21 '13 at 16:44
  • Okay. If no PSTricks solution appears, I'll accept your answer (but you can always get an upvote, which you will). – Svend Tveskæg Mar 21 '13 at 16:46

My code seems to be verbose but the extra code is actually to get the precise dimension and placement. It also make you more convenient to adjust the parameters.

enter image description here








% for circles

  \psclip{\pscustom{\multido{\nx=\a+\step}{\NplusOne}{\pscircle(\nx pt,0){8pt}}}}
  • There are too many circles – Jake Mar 21 '13 at 17:42
  • @Jake: I will adjust the parameters in the next update. – kiss my armpit Mar 21 '13 at 18:00
  • I cannot really follow what you are doing, but it looks fancy. :) Can you explain the code a bit, please? – Svend Tveskæg Mar 22 '13 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.