Plot[2x, {x,0,4}]
Plot[x^2, {x,10,12}]

How do I merge these two graphs into one graph without the range {4,10}?

  • 2
    $\begingroup$ You've seen Show[]? $\endgroup$ Oct 14, 2015 at 17:32
  • $\begingroup$ Greetings! To make the most of Mma.SE please take the tour now. Help us to help you, write an excellent question. Edit if improvable, show due diligence, give brief context, include minimum working examples of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. Why not choosing a meaningful name? $\endgroup$
    – rhermans
    Oct 14, 2015 at 17:33
  • $\begingroup$ Your question may be put on-hold as it seems to be off-topic, i.e it arises from a simple mistake (syntax error, incorrect capitalization, spelling mistake) and is unlikely to help any future visitors, or else it is easily found in the documentation. Don't be discouraged by that cleaning-up policy. Your future good questions are welcome. Learn about common pitfalls here. $\endgroup$
    – rhermans
    Oct 14, 2015 at 17:34
  • $\begingroup$ Alright, I've linked to a different duplicate. It should not be too hard to adapt the solutions in the linked dupe to your situation. $\endgroup$ Oct 15, 2015 at 12:08

1 Answer 1


Depending on your needs.

 Plot[2 x, {x, 0, 4}],
  Plot[x^2, {x, 0, 12}]


  Plot[{2 x, x^2}, {x, 0, 4}]
  • 1
    $\begingroup$ If my reading of the question is correct, the OP doesn't want the parts in the interval $(4,10)$ to show up. $\endgroup$ Oct 14, 2015 at 17:36
  • 1
    $\begingroup$ @J.M.isback. corrected, thanks $\endgroup$
    – rhermans
    Oct 14, 2015 at 17:37
  • $\begingroup$ @J.M.isback.: Yes, how can I do that? Thanks. $\endgroup$
    – hvphuc
    Oct 14, 2015 at 17:41
  • $\begingroup$ @hvphuc, did you already look up the thing I suggested in my first comment? $\endgroup$ Oct 14, 2015 at 17:44
  • 1
    $\begingroup$ @hvphuc In two separate plots? same plot with broken axes? Is there an example you can point? We are willing to help, but you don't explain thoroughly what your needs are. You need to help us to help you. You should have explained properly on the first instance on your original question. $\endgroup$
    – rhermans
    Oct 15, 2015 at 11:24

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