{"id":21279131,"url":"https://github.com/danielmartensson/wxplot","last_synced_at":"2025-06-11T22:37:19.646Z","repository":{"id":262732795,"uuid":"888146138","full_name":"DanielMartensson/wxPlot","owner":"DanielMartensson","description":"Real time plotting in wxWidgets - No dependencies","archived":false,"fork":false,"pushed_at":"2024-12-22T08:59:28.000Z","size":107604,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:47:43.840Z","etag":null,"topics":["cpp","plot","plots","plotting","real-time","wxwidgets"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielMartensson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-11-13T22:29:33.000Z","updated_at":"2025-04-07T08:41:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e6a5193-a5ea-4b28-9fa2-b7305408a4d4","html_url":"https://github.com/DanielMartensson/wxPlot","commit_stats":null,"previous_names":["danielmartensson/wxplot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DanielMartensson/wxPlot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartensson%2FwxPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartensson%2FwxPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartensson%2FwxPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartensson%2FwxPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielMartensson","download_url":"https://codeload.github.com/DanielMartensson/wxPlot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartensson%2FwxPlot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259355877,"owners_count":22845135,"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":["cpp","plot","plots","plotting","real-time","wxwidgets"],"created_at":"2024-11-21T10:19:20.712Z","updated_at":"2025-06-11T22:37:19.622Z","avatar_url":"https://github.com/DanielMartensson.png","language":"C++","readme":"# wxPlot V1.8\n\nThis project is called `wxPlot`. The project was created due to the lack of visualization tools that can be used in real time. Historically, there have been older libraries for wxWidgets at SourceForge that can offer graphical visualization of data. I made the decision to create an additional data visualization tool - `wxPlot`. But with a different starting point. The goal of this project is to be able to offer a visualization tool together with a proper documentation for further development. The visualization tool for the data must not have any dependencies on other libraries and the visualization tool must always be able to run in real time. The code is written in the latest standard of modern C++.\n\nwxPlot does not require any use of GPU.\n\n# Features and goals\n\n- Dynamic resizing\n- No dependencies at all\n- Real-time plotting\n- 2D plots and 3D plots\n- MATLAB inspired\n- Documentation about how to add your own plot into the library\n\n# Usage\n\nThe `wxPlot` library make its data visualization once `plot-\u003eRefresh();` is called.\n\n```cpp\n// Create plot\nwxPlot* plot = new wxPlot(this, WXPLOT_FIGURE_2D, WXPLOT_TYPE_SPLINE_SCATTER);\n    \n// Create data for line, scatter and spline - 2D\nstd::vector\u003cstd::vector\u003cdouble\u003e\u003e data1 = { {0, 100, 200, 300, 400, 500}, {-10, -15 , -30, 20, 25, 30},  // Temperature (X, Y)\n                                          { 0, 200, 300, 400, 500, 600 }, {0, 20 , 30, 35, 40, 42} };   // Speed (X, Y)\n\n// Create data for bar - 1D\nstd::vector\u003cdouble\u003e data2 = {-15.6, 20, 10, 50, 10, -80, 20 };\n\n// Create data for hist - 1D\nstd::vector\u003cdouble\u003e data3 = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 30, 30, 30, 40, 50, 50, 50, 50, 50, 50, 5, 5, 5, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1};\n\n// Legend\nstd::vector\u003cwxString\u003e legend = { \"Temperature\", \"Speed\", \"Velocity\", \"Pressure\", \"Acceleration\", \"Lumination\", \"Distance\"};\n\n// Settings\nplot-\u003esetFontSize(13);\nplot-\u003esetTitle(\"Measurement\");\nplot-\u003esetYlabel(\"Placement for units e.g [m/s]\");\nplot-\u003esetXlabel(\"Time e.g [s] or [h]\");\nplot-\u003esetTicks(5);\nplot-\u003elegendOn(false);\nplot-\u003egridOn(true);\nplot-\u003esetRadius(5);\nplot-\u003efillCircles(true);\nplot-\u003esetBinCount(8);\n\n// Set data \nplot-\u003esetData(data3);\nplot-\u003esetYlim(0, 15); // Put this directly after setData() for tuning the Y-axis\n\n// Set legend\nplot-\u003esetLegend(legend, PLACEMENT_SOUTH_WEST);\n\n// Set sizes\nplot-\u003esetPlotStartWidth(5);     // x1\nplot-\u003esetPlotStartHeight(5);    // y1\nplot-\u003esetPlotEndWidth(500);     // x2\nplot-\u003esetPlotEndHeight(500);    // y2\n\n// Render the plot\nplot-\u003eRefresh();\n```\n\nTo render the plot on size:\n\n```cpp\nvoid MainFrame::OnSize(wxSizeEvent\u0026 event) {\n    // If we don't use this, then refresh won't work\n    event.Skip();\n\n    // Get window size\n    wxCoord startWidth = 0, startHeight = 0, endWidth, endHeight;\n    GetClientSize(\u0026endWidth, \u0026endHeight);\n\n    // Redraw plot\n    plot-\u003esetPlotStartWidth(startWidth);\n    plot-\u003esetPlotStartHeight(startHeight);\n    plot-\u003esetPlotEndWidth(endWidth);\n    plot-\u003esetPlotEndHeight(endHeight);\n    plot-\u003eRefresh();\n}\n```\n\nTo render the plot on command:\n\n```cpp\nvoid MainFrame::OnCommand(wxCommandEvent\u0026 event){\n    // If we don't use this, then refresh won't work\n    event.Skip();\n\n    // Get window size\n    wxCoord startWidth = 0, startHeight = 0, endWidth, endHeight;\n    GetClientSize(\u0026endWidth, \u0026endHeight);\n\n    // Redraw plot\n    plot-\u003esetPlotStartWidth(startWidth);\n    plot-\u003esetPlotStartHeight(startHeight);\n    plot-\u003esetPlotEndWidth(endWidth);\n    plot-\u003esetPlotEndHeight(endHeight);\n    plot-\u003eRefresh();\n}\n```\n\n# Pictures\n\nLine plot with no filled scatters\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/2D_line_scatter_no_fill.png?raw=true)\n\nLine plot with filled scatters\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/2d_line_scatter_fill_large.png?raw=true)\n\nSpline plot\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/2D_spline_no_scatter.png?raw=true)\n\nSpline plot with filled scatters\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/2D_spline_with_scatter_fill.png?raw=true)\n\nBar plot\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/bar_plot_ready.png?raw=true)\n\nHistogram plot\n\n![a](https://github.com/DanielMartensson/wxPlot/blob/main/pictures/histogram.png?raw=true)\n\n# Build \u0026 Installation\nExample on building with CMake and Ninja.\nBefore building make sure wxWidgets is installed and can be found on the system. Navigate to the folder wxPlot and run the following to build the project:\n```\n\u003e pwd\n(your path to repo)/wxPlot/wxPlot\n\u003e mkdir build\n\u003e cmake -DCMAKE_BUILD_TYPE=Release -G Ninja -S . -B ./build\n\u003e ninja -C ./build\n\u003e ./build/wxPlot\n```\n\n# TODO\n\n- 3D plot\n- More MATLAB inspired use\n\n# Tutorial - Add your own plot\n\nGo to [How to create your own plot](https://github.com/DanielMartensson/wxPlot/tree/main/wxPlot/README.md)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmartensson%2Fwxplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielmartensson%2Fwxplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmartensson%2Fwxplot/lists"}