{"id":23387580,"url":"https://github.com/philippmeder/visdata","last_synced_at":"2026-05-22T20:30:16.910Z","repository":{"id":268262070,"uuid":"903041524","full_name":"PhilippMeder/visdata","owner":"PhilippMeder","description":"Useful python tools for data visualisation, e.g. 2D-profiles (also known as profile plots), comparison of measurements, or tables.","archived":false,"fork":false,"pushed_at":"2024-12-15T21:57:34.000Z","size":481,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T06:14:47.836Z","etag":null,"topics":["data-science","data-visualization","profile-plot","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilippMeder.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}},"created_at":"2024-12-13T20:01:20.000Z","updated_at":"2024-12-15T21:57:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d70467c-b817-431a-b817-d654f67272b2","html_url":"https://github.com/PhilippMeder/visdata","commit_stats":null,"previous_names":["philippmeder/visdata"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMeder%2Fvisdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMeder%2Fvisdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMeder%2Fvisdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippMeder%2Fvisdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippMeder","download_url":"https://codeload.github.com/PhilippMeder/visdata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131746,"owners_count":19752727,"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":["data-science","data-visualization","profile-plot","python","python-3","python3"],"created_at":"2024-12-22T01:58:54.031Z","updated_at":"2026-05-22T20:30:16.831Z","avatar_url":"https://github.com/PhilippMeder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\u003cimg src=\"./doc/figs/visdata_logo.svg\" width=\"300\"\u003e\n\u003c/h1\u003e\n\n**Useful tools for data visualisation, e.g. 2D-profiles, comparison of measurements, or tables.**\n\n***This package is still under development. The features work, but the API might change in the future.***\n\nDeveloped and maintained by [Philipp Meder](https://github.com/philippmeder).\n\n* **Source code:** https://github.com/philippmeder/visdata\n* **Report bugs:** https://github.com/philippmeder/visdata/issues\n\n## License\n\nDistributed under the [BSD 3-Clause License](./LICENSE).\n\n## Features\n\nThis README covers the following:\n1. [Profile2d Plot for 2D-histograms](#profile2d-plot-for-2d-histograms)\n2. [Visual Comparison of Measurements](#visual-comparison-of-measurements-including-uncertainties)\n3. [Table Output for Terminal, CSV, and LaTeX](#formatted-table-output-for-terminal-csv-and)\n4. [Additional Features](#additional-features)\n\nCheck out the [examples](./examples)!\n\n### Profile2d Plot for 2D-histograms\nProfiles allow a visual interpretation of the data, e.g. in the following figures where red markers represent the mean with the standard error on the mean and pink markers represent the median of the y-data in each x-bin:\n\nProfile shows an angle-dependent deviation from the zero line | Profile shows deviations from the model\n----|----\n![](doc/figs/profile2d_example_1.png) | ![](doc/figs/profile2d_example_2.png)\n\nCreate a Profile2d object with your data and directly add the profile to a plot (you may adjust what and how to plot, see Histogramd2d example) or get the profile data and do the plotting yourself.\n\n```python\nfrom matplotlib import pyplot as plt\nfrom visdata import Profile2d\n\n# Example data\nx, y = ...\n\n# Create normal 2D-histogram\nfig, ax = plt.subplots()\nhist, xedges, yedges, image = ax.hist2d(x, y, bins=10)\n\n# Create profile and add it to the axis (using default config)\nprofile = Profile2d(x, y, bins=10)\nprofile.add_to_axis(ax)\n```\n\nYou can also use a Histogram2d object which gives you the ability to directly draw a profile.\nIn addition, it allows to plot 1D-histograms of the x/y data on the margins, which looks like this:\n\n![](doc/figs/histogram2d_example.png)\n\nYou can configure the marginal plots and the profile, see the following example:\n\n```python\nfrom visdata import Histogram2d, Profile2dPlotConfigMean\n\nhist = Histogram2d(x, y, bins=bins)\n# Configure the marginal histograms if wanted, e.g. the color\n# Keywords are passed to 'ax.hist'\nhist.configure_marginal(color=\"C2\")\n# Configure the profile with a set of configs, e.g. only plot the mean but change the marker\nhist.configure_profile(\n    # Keywords are passed to 'ax.errorbar'\n    Profile2dPlotConfigMean(marker=\"v\")\n    # You could add another config here, e.g. to plot the median\n)\n# Plot hist2d with colorbar + 1D-histograms and profile\nfig, axs = hist.plot(marginal=True, profile=True)\n```\n\n### Visual Comparison of Measurements Including Uncertainties\n\nSometimes it is easier to understand if different measurements are compatible with each other by looking at a visualisation, e.g. you want to compare your own measurements of some parameters with the measurements presented in other publications with respect to the uncertainties.\nThe example shows\n- *statistical uncertainties* as medium thick errorbars,\n- *systematic uncertainties* as thin errorbars with caps,\n- *quadratic combination* of both as thick errobars with transparency (for visual guidance only, this value is meaningless).\n\nYou can  of course configure what and how to plot.\nIn this example, *Publication 1* did not provide any values for $\\beta$ and $\\delta$ while *Publication 2* did not provide a value for $\\gamma$.\n\n![](doc/figs/compare_measurements.png)\n\n```python\nfrom visdata import (\n    Measurement, MeasurementResult, CompareMeasurementsPlot\n)\n\n# Example measurements for multiple parameters\nmeasurement_1 = Measurement(\n    \"Measurement name\",\n    {\n        \"par 1 name\": MeasurementResult(\n            1, statistical=0.1, systematic=0.05\n        ),\n        ...\n    }\n)\nmeasurement_2 = ...\n\n# Create plot object and do the plotting\ncomp_plot = CompareMeasurementsPlot(measurment_1, measurement_2)\nfig, axs, handles, labels = comp_plot.plot()\n\n# At this point you can configure fig and axs the usual way or include a legend with handles and labels\n...\n```\n\n### Formatted Table Output for Terminal, CSV, and LaTeX\n\nCreate a Table object from a 2D-array and get the wanted output, either as a nice terminal output, a CSV table, or a LaTeX table ready for your document.\nYou can name the columns and rows independently and add a caption if you want. Furthermore, you can specify a formatter for the data.\n\n```python\nfrom visdata import Table\n\n# Setup data and example formatter\ndata, description, column_labels, row_labels = ...\nformatter = \"5.2f\"\n\n# Create table object\ntable = Table(\n    data,\n    description=description,\n    column_labels=column_labels,\n    row_labels=row_labels\n)\n# Print the terminal representation as well as CSV and LaTeX\nprint(table)\nprint(table.csv(formatter=formatter))\nprint(table.latex(formatter=formatter))\n```\n\nThe LaTeX output returns a scientific table.\nThe terminal representation mimics this, e.g.\n\n```console\n            Table: Some important values\n────────────────────────────────────────────────────\n              a0            a1            a2\n────────────────────────────────────────────────────\nA0              0.00e+00      1.00e+00      2.00e+00\nA1              3.00e+00      4.00e+00      5.00e+00\n────────────────────────────────────────────────────\n```\n\n### Additional Features\n- Decorators for code development, e.g. timer for function execution\n- Intervals\n- Functions like secans or cos called with angle in degrees\n- Regular polygons for plotting and calculation of their most important properties\n- Some utilities for matplotlib output\n\n## Installation and Requirements\n\nYou will need ``numpy`` and ``matplotlib`` in addition to  ``python 3.13`` (other python versions might work but were not tested). You can get the newest version using ``pip`` from the [github repository](https://github.com/philippmeder/visdata):\n\n```\npip install git+https://github.com/philippmeder/visdata\n```\n\nAn official PyPI release should be available in the near future.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippmeder%2Fvisdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippmeder%2Fvisdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippmeder%2Fvisdata/lists"}