I have a large set of data where every line is in the form:
{x1, x2, x3, x4, x5}
The values in column x2
cab be much larger than 150.
I would like to plot the data in a framed list plot, using on the row where $x2\in[0,\, 150]$. I would also like the frame to be larger than the PlotRange
specified interval, in order to label the different parts of the data (there are 7 of them) and for a label to appear next to a line using Epilog
.
I have tried to use Epilog
to label the lines without enlarging the frame and the labels are invisible. I have tried to use PlotRangePadding
to enlarge the frame, but it enlarges the plot range too.
I have tried to select the data manually with the following code:
list={};
For[i = 1, i < Length[data],
If[data[[i, 2]] > 0 && data[[i, 2]] < 150,
AppendTo[list, data[[i]]]];
i + 10]
but Mathematica crashes (the i + 10
is to reduce the data set).
Is there a way to obtain a plot with a plot range between 0 and 150, and the frame between 0 and 200, in order to have a white space where I can display the labels with Epilog
?
Select[x2, # <= 150]
$\endgroup$AppendTo
is very inefficient. If you are collecting data, useReap
andSow
. Also,For
is way (I mean WAY) slower thanDo
, a mathematica-native version ofFor
. $\endgroup$i
never changes (the lasti + 10
does nothing), resulting in an infinite loop and crash. That being said, I believeSelect
is a better option to use here. That is,Select[data, AllTrue[#, 0<=#<=150&]&]
$\endgroup$