1
$\begingroup$

I have generated a plot from t=0->1, and I wish to append another plot from t=1->2. How can I do this?

Thanks in advance.

$\endgroup$
3
  • 1
    $\begingroup$ Will this do what you want? g1=Plot[1/2Sin[2Pi t],{t,0,1}] and then g2=Plot[1/3Cos[2Pi t],{t,1,2}] followed by Show[{g1,g2},PlotRange->{{0,2},{-1,1}}] $\endgroup$
    – Bill
    Jan 26, 2015 at 1:23
  • 1
    $\begingroup$ Not exactly, both plots are over the same domain, 0->1. I need to show that the end of the first plot connects to the beginning of the second plot. Such as plotting Sin[x] on x=0->1 and then appending another Sin[x] x=0->1 but placing it on x=1->2 so it looks as 2 periods of Sin[x]. $\endgroup$
    – gKirkland
    Jan 26, 2015 at 1:44
  • $\begingroup$ I never would have guessed this from your original wording. OK, use t from 1 to 2 (to satisfy Plot), but use t-1 as the argument for your second function (to satisfy the 0 to 1 domain of your second function.) Thus my example code is only changed by substituting g2=Plot[1/3Cos[2Pi (t-1)],{t,1,2}]. Think your old Algebra 1 class with translation of functions. $\endgroup$
    – Bill
    Jan 26, 2015 at 6:18

1 Answer 1

3
$\begingroup$

Perhaps Translate?

p1 = Plot[1/2 Sin[2 Pi t], {t, 0, 1}]
Show[#, Graphics[Translate[#[[1]], {1, 0}]], PlotRange -> All] &@p1

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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