{"id":25232981,"url":"https://github.com/vistormu/udp2plot","last_synced_at":"2025-07-18T01:33:34.635Z","repository":{"id":275743221,"uuid":"925291214","full_name":"vistormu/udp2plot","owner":"vistormu","description":"this small python util is for plotting time-series data from a udp stream","archived":false,"fork":false,"pushed_at":"2025-02-27T15:54:15.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T17:11:10.282Z","etag":null,"topics":["plot","python","udp-server"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vistormu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-31T15:46:39.000Z","updated_at":"2025-02-27T15:54:19.000Z","dependencies_parsed_at":"2025-02-25T13:36:36.951Z","dependency_job_id":"c70f9650-ee3d-4b76-9f0f-45ee48eaf48d","html_url":"https://github.com/vistormu/udp2plot","commit_stats":null,"previous_names":["vistormu/udp2plot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vistormu/udp2plot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vistormu%2Fudp2plot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vistormu%2Fudp2plot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vistormu%2Fudp2plot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vistormu%2Fudp2plot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vistormu","download_url":"https://codeload.github.com/vistormu/udp2plot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vistormu%2Fudp2plot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265688260,"owners_count":23811402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plot","python","udp-server"],"created_at":"2025-02-11T13:55:54.736Z","updated_at":"2025-07-18T01:33:34.619Z","avatar_url":"https://github.com/vistormu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# from udp to a real-time plot\n\nthis small python util is for plotting time-series data from a udp stream\n\n## installation\n\nclone the repository and install the dependencies with pip:\n\n```bash\ngit clone https://github.com/vistormu/udp2plot.git\ncd udp2plot\n```\n\n```bash\npip install -r requirements.txt\n```\n\n\u003e [!NOTE]\n\u003e this script requires python 3.10 or higher\n\n## usage\n\n- the main idea behind this project is to be able to plot the information from peripherals, which are sending data through udp\n\n- there will be only one client at a time, and when it disconnects, it stops the plot and saves the data sent\n\n- the data will be saved with all the information sent by the client, including the ones that are not plotted\n\n- the filename of the saved data will be the current date and time in the format specified in the config file\n\ncreate a file called `config.toml` in the root directory of the project and fill it with the following content:\n\n### server config\n\n- ip: the ip address of the server. you can use `auto` to automatically detect the ip address\n- port: the port number of the server\n- timeout: the amount of time to consider as a client disconnect\n\n```toml\n[server]\nip = \"auto\"\nport = 8080\ntimeout = 2 # seconds\n```\n\n### data config\n\n- save: whether to save the data or not\n- path: the path to save the data. if the path does not exist, it will raise a warning and not save the data\n- date_format: the format of the date and time to save the data\n\n```toml\n[data]\nsave = false\npath = \"path/to/save/data\"\ndate_format = \"%d-%m-%Y_%H-%M-%S\"\n```\n\n### figure config\n\n- save: whether to save the figure or not\n- path: the path to save the figure. if the path does not exist, it will raise a warning and not save the figure\n- format: the format of the figure\n- date_format: the format of the date and time to save the figure\n\n```toml\n[figure]\nsave = false\npath = \"figures/\"\nformat = \"png\"\ndate_format = \"%d-%m-%Y_%H-%M-%S\"\n```\n\n### colors config\n\nyou can (must) define the colors of the lines in the plot \n\n```toml\n[colors]\nred = \"#cf7171\"\ngreen = \"#dbe8c1\"\nblue = \"#aecdd2\"\nyellow = \"#fadf7f\"\npurple = \"#c696bc\"\nblack = \"#4d5359\"\n```\n\n### plot config\n\n- layout: the layout of the plot. it can be `1x1`, `1x2`, `2x1`...\n- time_window: the time window of the plot in second. outside of this window, the data will be discarded\n- dt: the time step of the plot in second. it is a placeholder value to calculate the number of points to plot. may be removed in the future\n- size: the size of the plot in inches\n- padding: the top and bottom padding added to the limits of the plot. it is a percentage of the data range\n\n```toml\n[plot]\nlayout = \"2x2\"\ntime_window = 30 # seconds\ndt = 0.01 # s\nsize = [14, 8] # inches\npadding = 5 # percentage\n```\n\nto add plots to the specified layout, the keys of the plot config must be in the format of `plot.\"(\u003crow\u003e,\u003ccolumn\u003e)\"`\n\n- x: the name of the data to plot on the x-axis\n- y: the names of the data to plot on the y-axis\n- colors: the colors of the lines in the plot. should match the colors defined in the colors config\n- xlabel: the label of the x-axis\n- ylabel: the label of the y-axis\n- limits: the limits of the plot\n- title: the title of the plot\n- n_ticks: the number of ticks on the y-axis\n\nfor example, to add a plot to the first row and the first column, you must add a key called `plot.\"(1,1)\"`:\n\n```toml\n[plot.\"(1,1)\"]\nx = \"time\"\ny = [\"fx\", \"fy\", \"fz\"]\ncolors = [\"red\", \"green\", \"blue\"]\nxlabel = \"time (s)\"\nylabel = \"force (N)\"\nlimits = [-2, 2]\ntitle = \"force\"\nn_ticks = 10\n```\n\nyou can also set a plot to cover multiple rows or columns using python notation: `plot.\"(:,1)`\n\n### multiple configs\n\nin this project, i have multiple configs under the `configs` directory. you can use them by passing the name of the config file as an argument to the script:\n\n```bash\npython main.py --config path/to/config.toml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvistormu%2Fudp2plot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvistormu%2Fudp2plot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvistormu%2Fudp2plot/lists"}