1
$\begingroup$

I am trying to plot a joined plot. Some possible ways would be ListPlot with Joined -> True or ListLinePlot.

However, my data contains a big jump(a plot of order parameter describing a first order transition) and I want to erase a long vertical line which connects the first points before and after the jump.

To be specific, consider the following data

a = { {0,0}, {1,0}, {2,0}, {3,5}, {4,6}, {5,7} };

Then, we can observe that there is the largest jump between the data {2,0} and {3,5} and I want to erase the line between those points leaving other lines. What is the most elegant way to achieve it?

$\endgroup$
5
  • 1
    $\begingroup$ see this post ! $\endgroup$
    – SquareOne
    Commented Nov 22, 2014 at 17:59
  • $\begingroup$ @SquareOne Thank you. This seems helpful even though my problem is slightly different. I will try the method described in the post and then check if it can be applied to my problem. Since they are not exactly the same problem, I will leave this post open at this moment. Thanks for the info. $\endgroup$
    – Sungmin
    Commented Nov 22, 2014 at 18:03
  • 3
    $\begingroup$ Insert a Null (or anything that's not a real number) where you want a gap. ListLinePlot[{{0, 0}, {1, 0}, {2, 0}, Null, {3, 5}, {4, 6}, {5, 7}}] $\endgroup$
    – user484
    Commented Nov 22, 2014 at 18:06
  • $\begingroup$ @Rahul Thank you. It works perfectly. Could you post it as an answer so that I can accept your solution. $\endgroup$
    – Sungmin
    Commented Nov 22, 2014 at 18:14
  • $\begingroup$ The answer may be found in the documentation here, too. $\endgroup$
    – Michael E2
    Commented Nov 23, 2014 at 3:25

1 Answer 1

3
$\begingroup$

Insert a Null (or anything that's not a real number) where you want a gap.

ListLinePlot[{{0, 0}, {1, 0}, {2, 0}, Null, {3, 5}, {4, 6}, {5, 7}}]

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.