label

%y

%y

%y

%y

%y

Apple

B

C

D

apple

The graph

%y

M

toggle

label

offset6: 0.1
P6_sub = (5.780208486888981, 7.406611227917442)
dh: 1
P5_sub = (4.3026592466028015, 4.32168122304374)
offset5: -0.3
h5_sub: (round((y(P5_sub) - offset5) / dh) * dh) + offset5
bar_spacing: 1
center5: (bar_spacing * 4.5)
ymax = 20.246590167121497
ymin = -9.018556635869563
P4_sub = (3.65434682484458, 3.3211633836252425)
offset4: 5
center4: (bar_spacing * 3.5)
h4_sub: (round((y(P4_sub) - offset4) / dh) * dh) + offset4
P3_sub = (2.5, 15)
offset3: 1.2
h3_sub: (round((y(P3_sub) - offset3) / dh) * dh) + offset3
center3: (bar_spacing * 2.5)
P2_sub = (1.5, 10)
offset2: 0
center2: (bar_spacing * 1.5)
h2_sub: (round((y(P2_sub) - offset2) / dh) * dh) + offset2
offset1: 0.5
P1_sub = (0.5, 5)
h1_sub: (round((y(P1_sub) - offset1) / dh) * dh) + offset1
center1: (bar_spacing * 0.5)
xmax = 5.644515189311679
xmin = -1.4416903508363241
LL = Corner(1)
UR = Corner(3)
n_bars: 6
n_barsreal = Min(n_bars, 6)
P1 = DynamicCoordinates(P1_sub, center1, If[h1_sub > ymax, ymax, If[h1_sub < ymin, ymin, h1_sub]])
height1: y(P1)
P2 = DynamicCoordinates(P2_sub, center2, If[h2_sub > ymax, ymax, If[h2_sub < ymin, ymin, h2_sub]])
height2: y(P2)
P3 = DynamicCoordinates(P3_sub, center3, If[h3_sub > ymax, ymax, If[h3_sub < ymin, ymin, h3_sub]])
height3: y(P3)
P4 = DynamicCoordinates(P4_sub, center4, If[h4_sub > ymax, ymax, If[h4_sub < ymin, ymin, h4_sub]])
height4: y(P4)
P5 = DynamicCoordinates(P5_sub, center5, If[h5_sub > ymax, ymax, If[h5_sub < ymin, ymin, h5_sub]])
height5: y(P5)
bar_width: (bar_spacing * 0.9 / 2)
rect1, d, e, f, g = Polygon((center1 - bar_width, 0), (center1 + bar_width, 0), (center1 + bar_width, height1), (center1 - bar_width, height1))
rect2, a, b, c, h = Polygon((center2 - bar_width, 0), (center2 + bar_width, 0), (center2 + bar_width, height2), (center2 - bar_width, height2))
rect3, i, j, k, l = Polygon((center3 - bar_width, 0), (center3 + bar_width, 0), (center3 + bar_width, height3), (center3 - bar_width, height3))
rect4, m, n, p, q = Polygon((center4 - bar_width, 0), (center4 + bar_width, 0), (center4 + bar_width, height4), (center4 - bar_width, height4))
rect5, r, s, t, a_1 = Polygon((center5 - bar_width, 0), (center5 + bar_width, 0), (center5 + bar_width, height5), (center5 - bar_width, height5))
label1displayed: label1
label2displayed: label2
label3displayed: label3
label4displayed: label4
label5displayed: label5
titledisplayed: title
ylabelsub = RotateText(ylabel, π / 2)
ylabeldisplayed: ylabelsub
height1_set: 5
height2_set: 10
height3_set: 15
height4_set: 0
height5_set: 2
ylabeloffset: 0.15
h6_sub: (round((y(P6_sub) - offset6) / dh) * dh) + offset6
center6: (bar_spacing * 5.5)
P6 = DynamicCoordinates(P6_sub, center6, If[h6_sub > ymax, ymax, If[h6_sub < ymin, ymin, h6_sub]])
height6: y(P6)
height6_set: 1
rect6, f_1, g_1, h_1, i_1 = Polygon((center6 - bar_width, 0), (center6 + bar_width, 0), (center6 + bar_width, height6), (center6 - bar_width, height6))
label6display: label6
lb1: "" + height1 + ""
lb2: "" + height2 + ""
lb3: "" + height3 + ""
lb4: "" + height4 + ""
lb5: "" + height5 + ""
lb6: "" + height6 + ""
lb1displayed: lb1
lb2displayed: lb2
lb3displayed: lb3
lb4displayed: lb4
lb5displayed: lb5
lb6displayed: lb6
heights = First({height1, height2, height3, height4, height5, height6}, n_barsreal)
nonNegHeights: Sum[Zip[a ≥ 0, a, heights]] ≟ n_barsreal
sumHeights = Sum(heights)
heightsSumToOne: abs(sumHeights - 1) ≤ 0.001
isProbDist: heightsSumToOne ∧ nonNegHeights
points = First({P1, P2, P3, P4, P5, P6}, n_barsreal)
lines = PolyLine(points)
display_bars = true
display_line = false
xlabeldisplayed: xlabel