SVGdatashapes examples:   sampledata.py




# Return sample data based on 'setid' request .... to avoid cluttering up example code modules

def datapoints( setid ):

    if setid == 'set1': 
        return [ (-6.3, -5.2), (0.4, 1.8), (8.1, 8.7), (-3.7, -5.1), (8.6, 8.2), (-7.5, -8.3), (-8.0, -9.2),
         (-9.8, -9.1), (-6.7, -5.5), (7.6, 6.9), (-3.0, -2.3), (-4.8, -5.4), (-1.1, -0.8), (6.4, 5.7), (-5.2, -5.7),
         (9.7, 9.9), (5.9, 4.9), (-1.1, -2.5), (-8.3, -8.5), (5.8, 5.5), (9.1, 7.6), (-3.8, -3.8), (-7.0, -6.1),
         (-1.9, -2.7), (-5.9, -6.1), (0.3, -0.1), (-3.4, -4.7), (8.9, 8.9), (1.0, 2.1), (-3.5, -4.7), (4.0, 1.6),
         (2.9, 8.3), (-0.2, 5.6), (2.4, -4.1), (1.4, -7.0), (1.6, 7.6), (-1.0, -9.0), (8.8, 0.7), (-5.1, 5.4), (5.7, -4.5) ]

    elif setid == 'set2':
        return [ (4.9, 4.2), (-4.9, -3.8), (8.6, 8.7), (0.9, 1.1), (-7.8, -7.9), (-0.1, 0.0), (8.6, 8.0), (-3.4, -3.1),
         (-3.8, -4.5), (6.7, 8.1), (-3.4, -3.0), (8.4, 8.4), (-4.3, -5.1), (2.8, 3.4), (5.4, 5.3), (4.0, 4.9), (8.3, 9.6),
         (7.7, 6.9), (1.7, 2.2), (-6.8, -6.0), (6.4, 5.8), (4.4, 3.8), (2.8, 4.3), (-2.0, -0.8), (-5.4, -5.7), (-0.2, 1.2),
         (-3.3, -2.2), (5.7, 5.5), (2.2, 1.9), (-0.2, 0.9), (7.7, -8.1), (-7.6, -8.0), (8.3, 3.7), (-9.9, -0.3), (7.2, 6.0),
         (-8.6, -3.6), (1.4, 1.8), (-5.5, 8.6), (1.1, -2.0), (7.8, -2.3) ]

    else:
        raise( ValueError, 'unrecognized setid' )
        return None