A simple live plotter via socket.
Project description
socket-plotter
Instant plotter based on pyqtgraph
via socket communication.
Installation
- (if you want) create a python environment
- install PySide2 manually
pip install PySide2
orconda install -c conda-forge pyside2
pip install socket-plotter
dependency
- PySide2
- pyqtgraph
Usage
from socket_plotter import plot_lines, plot_image, plot_image_and_lines
import numpy as np
# for line plot
xdata = np.arange(100)
ydata = np.random.randn(100)
plot_lines(xdata, ydata)
# for image plot
img = np.random.randn(100, 100)
plot_image(img)
# for both, the image and each row of the image are displayed.
img = np.random.randn(100, 100)
plot_image_and_lines(img)
The above three functions check if a plotter process exists. If needed, a new plotter process will be launched before plotting.
address and ports
The default ports are 8765
for lineplot and 8766
for imageplot.
The default address is 127.0.0.1
.
Other ports and address can be assigned as the following:
plot_lines(xdata, ydata, addr='<address to plotter>', port=7777)
python environment
You can specify your python executable to launch plotter GUIs via an environment variable SOCKETPLOTTER_PYTHON_EXECUTABLE
screenshots
Change log
[0.1.3]
- headers should be json-formatted.
- implement json-based data transfer
[0.1.2]
- executable switch via
SOCKETPLOTTER_PYTHON_EXECUTABLE
[0.1.1]
- removed PySide2 from
install_requires
to avoid automatic installation by package managers for compatibility for pip and anaconda environments
[0.1.0]
- released
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
socket-plotter-0.1.3.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file socket-plotter-0.1.3.tar.gz
.
File metadata
- Download URL: socket-plotter-0.1.3.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d07e788d4798af5d0ab8bc8dd6f967bba66467be2c0219e9a443721d302dac5 |
|
MD5 | 6e758afe37f7ec079fa59f911af0dcd4 |
|
BLAKE2b-256 | e5ad4d8a30ced9f6eb08408c9e815a6cd37d99917fba5756d4f4c1671460da5a |
File details
Details for the file socket_plotter-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: socket_plotter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ab4cf0cc77a26d1fd9a0a04241ace25c919fda3797c148e8a2e31cd98521e87 |
|
MD5 | e0cd1218a5e4beba5f40c2b33bb4636c |
|
BLAKE2b-256 | 723a106227d5a8fc4d8f32a1e337975067b1c2604f68311de7e6a544da3699bf |