Ejemplo n.º 1
0
 def test_light_export(self):
     data = pandas.DataFrame(
         {
             "x": [i for i in range(0, 10)],
             "y": [round(random.gauss(100, 10), 2) for i in range(0, 10)],
             "group": ["default"] * 10,
         }
     )
     plt = quorra.line().data(data, x="x", y="y", group="group").xlabel("X Label").ylabel("Y Label").zoomable(True)
     outfile = ".quorra-export-test-light-export.png"
     quorra.export(plt, outfile)
     self.assertTrue(os.path.exists(outfile))
     os.remove(outfile)
     return
Ejemplo n.º 2
0
 def test_light_export(self):
     data = pandas.DataFrame({
         'x': [i for i in range(0, 10)],
         'y': [round(random.gauss(100, 10), 2) for i in range(0, 10)],
         'group': ['default']*10
     })
     plt = quorra.line()\
         .data(data, x='x', y='y', group='group')\
         .xlabel('X Label').ylabel('Y Label')\
         .zoomable(True)
     outfile = '.quorra-export-test-light-export.png'
     quorra.export(plt, outfile)
     self.assertTrue(os.path.exists(outfile))
     os.remove(outfile)
     return
Ejemplo n.º 3
0
 def test_heavy_export(self):
     points = 10000
     groups = ["one", "two", "three", "four", "five"]
     data = pandas.DataFrame(
         {
             "x": [i for i in range(0, points)] * len(groups),
             "y": [round(random.gauss(100, 10), 2) for i in range(0, points * len(groups))],
             "group": [grp for grp in groups for j in range(0, points)],
         }
     )
     plt = quorra.line().data(data, x="x", y="y", group="group").xlabel("X Label").ylabel("Y Label")
     outfile = ".quorra-export-test-heavy-export.png"
     quorra.export(plt, outfile)
     self.assertTrue(os.path.exists(outfile))
     os.remove(outfile)
     return
Ejemplo n.º 4
0
 def test_heavy_export(self):
     points = 10000
     groups = ['one', 'two', 'three', 'four', 'five']
     data = pandas.DataFrame({
         'x': [i for i in range(0, points)]*len(groups),
         'y': [round(random.gauss(100, 10), 2) for i in range(0, points*len(groups))],
         'group': [grp for grp in groups for j in range(0, points)]
     })
     plt = quorra.line()\
         .data(data, x='x', y='y', group='group')\
         .xlabel('X Label').ylabel('Y Label')
     outfile = '.quorra-export-test-heavy-export.png'
     quorra.export(plt, outfile)
     self.assertTrue(os.path.exists(outfile))
     os.remove(outfile)
     return
Ejemplo n.º 5
0
import quorra
import pandas

df = pandas.DataFrame({'size': [1,2,3,1,2,3], 'rfu': [1,2,3,5,6,7], 'channel': ['fam', 'fam', 'fam', 'ned', 'ned', 'ned']})

plt = quorra.line()\
    .data(df, x='size', y='rfu', group='channel')\
    .opacity(0.75).lposition("outside")\
    .lshape("circle").labelposition("end")

quorra.export(plt, 'tmp.png')