Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote some code to get a piecewise plot which is displayed correctly. Now I'd like to join the various parts of the plot, using some kind of interpolation, to get a continuous chart even though it's actually a piecewise one.

Let me to give you an example. Assuming $f_1(2) = 3$ and $f_2(2) = 1$, how can I join the points $(2,3)$ and $(2,1)$ in the plot?

share|improve this question
Should we assume that f1(3) and f2(1) are undefined? – Sparr Mar 22 '13 at 21:01
up vote 15 down vote accepted

Your questions is not that clear to me, but I guess you want to join the two piece wise parts with a vertical line. That would be Exclusions.

Plot[Piecewise[{{3, x < 2}, {1, x > 2}}], {x, -2, 5}, Exclusions -> None]

leads to

enter image description here

share|improve this answer
Thanks you, what I needed! – FrankBr Mar 23 '13 at 7:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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