2 import sys
; sys
.path
[:0] = ["../.."]
5 d1
= graph
.data
.points([(1.5, 1, 0.3),
13 (14, 0.5, 0.4)], x
=1, dx
=2, y
=3)
14 d2
= graph
.data
.data(d1
, y
="x", dy
="dx", x
="y", copy
=0)
15 d3
= graph
.data
.points([(1, 0.3),
20 d4
= graph
.data
.data(d3
, y
="x", x
="y")
24 def draw(d
, xpos
, ypos
, autohistogramaxisindex
=0, autohistogrampointpos
=0, fillablesteps
=0, **kwargs
):
25 g
= c
.insert(graph
.graphxy(xpos
, ypos
, width
=8, **kwargs
))
26 g
.plot(d
, [graph
.style
.histogram(fillable
=1, steps
=fillablesteps
, lineattrs
=[color
.rgb
.green
, style
.linewidth
.THIck
, deco
.filled([color
.rgb
.blue
])],
27 autohistogramaxisindex
=autohistogramaxisindex
, autohistogrampointpos
=autohistogrampointpos
)])
28 g
.plot(d
, [graph
.style
.histogram(steps
=1, lineattrs
=[color
.rgb
.red
, style
.linewidth
.Thick
],
29 autohistogramaxisindex
=autohistogramaxisindex
, autohistogrampointpos
=autohistogrampointpos
)])
30 g
.plot(d
, [graph
.style
.histogram(steps
=0,
31 autohistogramaxisindex
=autohistogramaxisindex
, autohistogrampointpos
=autohistogrampointpos
)])
35 draw(d3
, 10, 7, autohistogramaxisindex
=0, autohistogrampointpos
=0)
36 draw(d4
, 0, 7, autohistogramaxisindex
=1, autohistogrampointpos
=1)
37 draw(d1
, 10, 14, x
=graph
.axis
.lin(min=3, max=14), y
=graph
.axis
.lin(min=-0.1, max=0.45))
38 draw(d2
, 0, 14, y
=graph
.axis
.lin(min=3, max=14), x
=graph
.axis
.lin(min=-0.1, max=0.45))
39 draw(d1
, 10, 21, fillablesteps
=1, x
=graph
.axis
.lin(min=3, max=14), y
=graph
.axis
.lin(min=-0.1, max=0.45))
40 draw(d2
, 0, 21, fillablesteps
=1, y
=graph
.axis
.lin(min=3, max=14), x
=graph
.axis
.lin(min=-0.1, max=0.45))
41 c
.writeEPSfile("test_histogram")
42 c
.writePDFfile("test_histogram")
43 c
.writeSVGfile("test_histogram")