Exemplo n.º 1
0
from gram import Plot

xx1 = [2.3, 3.5, 7.]
yy1 = [3.3, 1.2, 5.6]

xx2 = [-19.3, -14.3, -10.5]
yy2 = [-2.6, -15.9, -9.3]

gp = Plot()
gp.baseName = 'plotArrayB'
gp.line(xx1, yy1, smooth=True)
gp.scatter(xx1, yy1)
gp.yAxis.title = 'widgets'
gp.xAxis.title = 'time (hours)'
gp.minXToShow = 0.0

gp2 = Plot()
gp2.line(xx2, yy2, smooth=False)
gp2.scatter(xx2, yy2)
gp2.yAxis.title = 'spin'
gp2.yAxis.position = 'r'
gp2.xAxis.title = 'impetus'
gp2.gX = 4.3
gp2.gY = 0.

gp.grams.append(gp2)
gp.png()
gp.svg()  # smooth line plots do not work in svg
Exemplo n.º 2
0
        c = gp.scatter(xx1, yy1,
                       plotMark=thePlotMark)
        gp.minXToShow = 0.0
        gp.minYToShow = 0.0
        gp.maxXToShow = 1.0
        gp.maxYToShow = 1.0
        theText = '[%i.%i]' % (i, j)
        c = gp.xYText(0.5, 0.5, theText)
        c.colour = 'blue'

        if i == 0:
            gp.xAxis.title = None
            gp.xAxis.styles.remove('ticks') 
        else:
            gp.xAxis.title = 'xx1'
        if j == 0:
            gp.yAxis.title = 'yy1'
        else:
            gp.yAxis.title = None
            gp.yAxis.styles.remove('ticks')
        gp.gX = j * 3.2
        gp.gY = i * -2.7
        gg.append(gp)

gr = gg[0]
gr.baseName = 'plotArray'
gr.grams += gg[1:]
#gr.png()
gr.svg()