[go: up one dir, main page]

Skip to content

A Python library that lets you display graphs in streaming, simply and easily. Especially suitable for scientific use.

License

Notifications You must be signed in to change notification settings

Canicio/graphtiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphTiny

A Python library that lets you display graphs in streaming, simply and easily. Especially suitable for scientific use.

It is an abstraction layer for the PyQtGraph library.


Requirements

  • Python 3.5+

Install

pip install graphtiny

Examples

Display graph in streaming with random values:

import random
from time import sleep
from graphtiny.service import ChartService, DataStreamWindowService
from graphtiny.domain import Chart, DataStreamWindow

window = DataStreamWindow()
chart1 = Chart()
window.charts_list.append(chart1)
DataStreamWindowService().launch_window(window)
chart_service = ChartService()
for i in range(5, 200):
    sleep(0.1)
    chart_service.set_data_stream(chart1, i, random.randrange(0, i))



You can display multiple graphs per window:

window = DataStreamWindow()
window.columns_display = 2
chart1, chart2, chart3, chart4 = Chart(), Chart(), Chart(), Chart()
window.charts_list.append(chart1)
window.charts_list.append(chart2)
window.charts_list.append(chart3)
window.charts_list.append(chart4)
DataStreamWindowService().launch_window(window)
chart_service = ChartService()
for i in range(5, 200):
    sleep(0.1)
    chart_service.set_data_stream(chart1, i, random.randrange(0, i))
    chart_service.set_data_stream(chart2, i, random.randrange(0, i))
    chart_service.set_data_stream(chart3, i, random.randrange(0, i))
    chart_service.set_data_stream(chart4, i, random.randrange(0, i))



You can change the colors:

from graphtiny.util import Colors

window = DataStreamWindow()
window.background_color = Colors.BLACK  # black
window.coordinate_system_color = Colors.WHITE  # white
chart1 = Chart()
chart1.line_color = '#01DF01'  # green


License

MIT (Massachusetts Institute of Technology)

About

A Python library that lets you display graphs in streaming, simply and easily. Especially suitable for scientific use.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages