pyOFC2 Python Open Flash Chart 2

Scatter Chart

Make a scatter chart

Note: The above plot should look circular but looks elliptical instead because the y-axis is scaled w.r.t x-axis (780:300).

def test_scatter_chart():
                     
    chart = open_flash_chart()
    chart.title = title(text='Scatter Chart')
    s1 = scatter(colour="#FFD600", dot_size=10)
    s1.values = [scatter_value(x=0, y=0)]
    chart.add_element(s1)
    s2 = scatter(colour="#D600FF", dot_size=3)
    s2.values = scircle()
    chart.add_element(s2)
    x = x_axis()
    y = y_axis()
    x.min, x.max, x.steps = -2, 2, 1
    y.min, y.max, y.steps = -2, 2, 1
    chart.x_axis = x
    chart.y_axis = y
    return chart

Data used to generate the chart — scatter_chart.json

© 2009 Pradeep Kishore Gowda