Hi again,
Probably it's me but with my real data I cannot find an easy way to set the extent in such way breakpoint lines are displayed vertically but not sloped.
Do you know what I'm missing?
| b data dataSet dataPoints win alleleCount breakPoints |
win := '11:85 00:301 01:493 00:639 11:1063 00:1458 11:1754 00:2110 11:2299 00:2705 11:2786 01:2998 11:3213 01:3388 00:3495 01:4004 00:4156 11:4249 00:4339 11:4462 01:4997 00:5585' lines.
dataPoints := (win first findTokens: Character space) collect: [ : dp | dp findTokens: $: ].
breakPoints := (dataPoints collect: #second) collect: #asNumber.
alleleCount := dataPoints collect: [ : a | a first = '11' ifTrue: [ 2 ] ifFalse: [ a first = '01' ifTrue: [ 1 ] ifFalse: [ 0 ] ] ].
data := breakPoints with: alleleCount collect: [ : bp : ac | bp @ ac ].
b := RTGrapher new.
b extent: 570 @ 200.
dataSet := RTDataSet new.
dataSet dotShape rectangle
height: 1;
width: 25;
color: Color blue.
dataSet connectUsing: (RTLine new
color: (Color blue);
width: 1;
withHorizontalAttachPoint; yourself).
dataSet
points: data;
x: #x;
y: #y.
b add: dataSet.
b axisX.
b axisY title: 'alleles Count'.
b build.
Hernán