I would like to plot a matrix of zeros and ones into a figure such that for every 1 i have a marker shaped like a vertical bar is plotted ” | “. Such that when a series of 1s are on the same x axis, the look like a long straight line.
This example illustrates my intentions:
Given the following matrix:
0 0 1 1 0 1 0
0 1 0 1 1 1 0
0 1 0 1 1 1 0
1 0 0 1 1 1 0
I get:

EDIT:
The solution below, although a bit longer than the currently accepted one, has the advantage that it creates a single LINE object (UI performance is better if you create fewer graphics objects). It works by using
NaNto separate the segments: