I have a list (imported from csv file) of the form
data = {{1, "26/06/2006 15:00", 3, 0}, {2, "26/06/2006 15:05", 8, 0},
{3, "26/06/2006 15:10", 9, 0}, {4, "26/06/2006 15:15", 8.5, 0},
{5, "26/06/2006 15:20", 7, 0}, {6, "26/06/2006 15:25", 6, 1},
{7, "26/06/2006 15:30", 3, 0}}
I want to plot the third and forth columns, where the third, the sample value, is joined, the forth, a flag, is not.
I only want to have a marker for the second option if it's value is 1 (not zero more generally). I have tried a couple of options that don't quite work.
ListPlot[{data[[;;, 3]], data[[;;, 4]]*10},
Joined -> {True, False}, Filling -> Axis]
Ideally I don't want the first set with Filling
, but I couldn't get it to use different arguments for both with
Filling -> {None, Axis}
I also don't want the 0 markers to show.
Effectively my 0/1 are just flags, I'll manually set a multiple for this to show nicely on the plot.
I tried to use Select
, however this created a new list of just the 1 flags.
My actual dataset is many hundreds of thousands of lines, this is just a small example.
I have also tried making two separate plots, restricting the PlotRange
and using Show
, but as I need 0 in the first plot this didn't work. I could solve the filling problem this way.
EDIT: Error in the sample data, the first column should have indicated the x-value/ID