{"id":31710955,"url":"https://github.com/chitaoji/dataplot","last_synced_at":"2026-04-24T11:12:48.374Z","repository":{"id":306716892,"uuid":"727165592","full_name":"Chitaoji/dataplot","owner":"Chitaoji","description":"Provides plotting tools useful in datascience.","archived":false,"fork":false,"pushed_at":"2026-03-27T00:17:53.000Z","size":1368,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T12:49:44.160Z","etag":null,"topics":["plot","python","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/Chitaoji.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-04T10:14:56.000Z","updated_at":"2026-03-19T07:06:30.000Z","dependencies_parsed_at":"2025-10-09T01:02:05.272Z","dependency_job_id":null,"html_url":"https://github.com/Chitaoji/dataplot","commit_stats":null,"previous_names":["chitaoji/dataplot"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Chitaoji/dataplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chitaoji%2Fdataplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chitaoji%2Fdataplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chitaoji%2Fdataplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chitaoji%2Fdataplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chitaoji","download_url":"https://codeload.github.com/Chitaoji/dataplot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chitaoji%2Fdataplot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31308446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","python3"],"created_at":"2025-10-09T00:50:34.437Z","updated_at":"2026-04-24T11:12:48.367Z","avatar_url":"https://github.com/Chitaoji.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dataplot\nProvides plotting tools useful in datascience.\n\nA lightweight plotting library for data science that unifies data transformation and plotting in a single chainable API. `dataplot` is designed for fast exploration, teaching demos, and script-based analysis workflows.\n\n## Installation\n```sh\n$ pip install dataplot\n```\n\n## Features\n`dataplot` focuses on an **analysis-first plotting workflow**: data processing and visual diagnostics are written in one concise chain.\n\n| Capability | What it gives you | Typical API |\n| --- | --- | --- |\n| 📦 Data-as-object API | Treat raw arrays/series as first-class plotting objects with metadata and settings. | `dp.data(...)` |\n| 🔗 Composable transforms | Build reproducible feature pipelines before plotting. | `.rolling().demean().zscore().rank()` |\n| 📊 Statistical chart set | Switch between distribution, trend, and diagnostic views quickly. | `.hist()`, `.plot()`, `.scatter()`, `.qqplot()` |\n| 🧩 Artist-first composition | Compose multiple plots into one figure in a clean, deferred style. | `dp.figure(artist1, artist2, ...)` |\n| 🎛️ Layered settings model | Configure defaults at dataset / axes / figure scope with consistent fallback. | `set_plot()`, `set_axes()`, `set_figure()` |\n| 🐍 Scientific Python stack | Keep compatibility with familiar numeric and plotting ecosystems. | `numpy`, `pandas`, `scipy`, `matplotlib`, `seaborn` |\n\nIn short: **less boilerplate, clearer analysis flow, and more reusable plotting code**.\n\n## Quick Start\n```py\nimport dataplot as dp\nimport numpy as np\n\nraw = np.random.randn(300)\nx = dp.data(raw, label=\"daily_return\")\n\nartist1 = x.hist(bins=30, alpha=0.7)\nartist2 = x.qqplot(baseline=\"normal\")\n\nfig = dp.figure(artist1, artist2, title=\"Distribution diagnostics\")\nfig\n```\n\n## Core Concepts\n### `dp.data(...)`\n`dp.data(...)` is the entry point of `dataplot`.\nIt converts array-like input (for example `list`, `numpy.ndarray`, `pandas.Series`, or another `PlotDataSet`) into a unified `PlotDataSet` object.\n\n`PlotDataSet` is the core abstraction that carries:\n- **data values**\n- **transformation history**\n- **plot-level settings** (labels, style hints, etc.)\n\nThis design keeps analysis context attached to the data itself.\n\n```py\nimport dataplot as dp\nimport numpy as np\n\nraw = np.random.randn(300)\nx = dp.data(raw, label=\"daily_return\")\n```\n\n### Typical Workflow\n```text\nRaw data -\u003e dp.data(...) -\u003e transform chain -\u003e artist(s) -\u003e dp.figure(...)\n```\n\nYou can think of `dataplot` as a 4-step loop:\n1. **Wrap** your data with `dp.data(...)`.\n2. **Transform** it with chainable operations (`rolling`, `zscore`, `rank`, ...).\n3. **Render** one or more `Artist` objects via plot methods.\n4. **Compose** artists into a figure and apply final figure/axes settings.\n\n### Data Operations\n`PlotDataSet` supports both arithmetic operators and built-in transforms:\n- **Arithmetic**: `+ - * / **`\n- **Log / power family**: `log()` / `log10()` / `signedlog()` / `signedlog10()` / `pow()` / `root()` / `sqrt()` / ...\n- **Statistical transforms**: `rolling()` / `demean()` / `zscore()` / `rank(pct=True)` / `cumsum()` / `abs()`\n- **State management**: `copy()` / `reset()` / `undo_all()` / `resample()`\n\nOperations are chainable, which is useful for quick experimentation:\n\n```py\nx.zscore().rolling(5).rank(pct=True)\n```\n\n### Plot Methods\nEvery plot method returns an `Artist` object instead of drawing immediately.\nThis enables deferred composition and clean multi-panel figure assembly:\n- **Distribution**: `hist(...)`\n- **Trend / relationship**: `plot(...)`, `scatter(...)`\n- **Goodness-of-fit diagnostics**: `qqplot(...)`, `ppplot(...)`, `ksplot(...)`\n- **Structure overview**: `corrmap(...)`\n\n```py\nartist1 = x.hist(bins=30, alpha=0.7)\nartist1  # show one plot\n```\n```py\nartist2 = x.qqplot(baseline=\"normal\")\nfig = dp.figure(artist1, artist2, title=\"Distribution diagnostics\")\nfig  # show both plots\n```\n\n### Plot Settings\nCommon settings:\n- `title`, `xlabel`, `ylabel`\n- `alpha`, `grid`, `grid_alpha`\n- `style`, `figsize`, `dpi`\n- `fontdict`, `legend_loc`\n- `subplots_adjust`\n- `reference_lines` (for example: `\"y=x\"`, `\"y=0\"`, `\"x=1\"`)\n\n## Requirements\n```txt\nvalidating\nlazyr\nloggings\nmatplotlib\nnumpy\npandas\nscipy\nseaborn\n```\n\n## See Also\n### Github repository\n* https://github.com/Chitaoji/dataplot/\n\n### PyPI project\n* https://pypi.org/project/dataplot/\n\n## License\nThis project falls under the BSD 3-Clause License.\n\n## History\n### v0.1.11\n* Added arithmetic operator support to `MultiObject` (including reflected operators), enabling element-wise math workflows for grouped `PlotDataSet` objects with length checks.\n* Improved numerical robustness in `utils.math` by consistently sanitizing `NaN`/`Inf` inputs and validating finite sample counts in 1D linear regression.\n* Refined `PlotDataSet.plot()` / `PlotDataSet.scatter()` x-tick handling to accept broader array-like inputs and convert them consistently.\n* Added and expanded unit tests for core/container behavior and utility modules.\n\n### v0.1.10\n* Renamed `dist_or_sample=` to `baseline=` in `PlotDataSet.qqplot()` for clearer baseline specification.\n* Removed `edge_precision=` from `PlotDataSet.ppplot()` and `PlotDataSet.ksplot()`, and refined probability-range handling in the related diagnostic plotting flow.\n* Improved QQ/PP plot readability by updating default axis labels and ensuring the rightmost x-axis tick label is preserved.\n\n### v0.1.9\n* New method `PlotDataSet.rank(pct=True)` for rank transformation, supporting `pct=False` to return raw ranks.\n* Updated scatter behavior with improved defaults and removed implicit x-axis sorting.\n* Refactored plotting APIs to remove the `ax` constructor argument for a cleaner artist construction flow.\n\n### v0.1.8\n* Improved naming inference in `dp.data(...)` when decorators from `validating` are involved.\n* Refined module exports around artist helpers to make wildcard-style artist imports behave consistently.\n* Refactored plot-setting fallback behavior to use `dp.defaults` as the global source of defaults.\n* Enhanced `get_setting(...)` (including overload/type-hint coverage) so default values align with the corresponding setting types, and dict defaults are handled more safely.\n* Removed legacy `set_default()` usage and simplified setting application paths across artists/containers.\n* Added dependency `loggings` and updated warning emission in figure setting flows.\n\n### v0.1.7\n* `dp.data(...)` can accept `PlotDataSet` objects now.\n* `FigWrapper.__enter__()` now returns a copy safely via `_entered_copy`.\n* Internal maintenance and stability refinements.\n\n### v0.1.6\n* New method `PlotDataSet.scatter()` to draw true scatter charts while keeping `PlotDataSet.plot()` as line chart behavior.\n* Improved automatic label inference for `dp.data(...)`, plotting labels, and x-axis labels in interactive contexts.\n* Plot builders now use deferred drawing; removed `dp.show()` and improved axis/figure rendering in object representations.\n* Refined rendering stability with fixes for empty-axis cleanup and figure re-rendering in `FigWrapper.__repr__`.\n* Updated minimum required Python version to \u003e=3.13.\n\n### v0.1.5\n* Fixed issue: unworking figure settings in the artist methods.\n\n### v0.1.4\n* Fixed issue: incorrectly displayed histogram statistics when the x-label had been modified by the user.\n\n### v0.1.3\n* Allowed users to set the plot-settings by kwargs in artist methods like `PlotDataSet.hist()`, `PlotDataSet.plot()`, etc.\n* New operation methods `PlotDataSet.signedpow()` and `PlotDataSet.log10()`.\n* Renamed `PlotDataSet.signlog()` to `.signedlog()`; renamed `PlotDataSet.opclear()` to `.undo_all()`; removed `PlotDataSet.opclear_records_only()`.\n* New optional parameter `format_label=` for `PlotDataSet.set_plot()` to decide whether to format the label when painting on the axes.\n* When defining the data classes, used *dataclasses* instead of *attrs* for a faster import.\n\n### v0.1.2\n* New methods `PlotDataSet.corrmap()`, `PlotDataSet.ppplot()`, and `PlotDataSet.resample()`.\n* New optional parameter `fmt=` for `PlotDataSet.plot()`, `PlotDataSet.qqplot()`, `PlotDataSet.ppplot()`, and `PlotDataSet.ksplot()`.\n* Bugfix.\n\n### v0.1.1\n* New module-level function `dp.show()`.\n* New methods `PlotDataSet.qqplot()`, `PlotDataSet.ksplot()` and `PlotDataSet.abs()`.\n* All the plotting method (e.g., `.hist()`) will now return an `Artist` object instead of None.\n* New plot settings: `grid` and `grid_alpha`.\n* Parameters of `FigWrapper.set_figure()`, `AxesWrapper.set_axes()` and `PlotDataSet.set_plot()` are keyword-only now.\n* The returns of `.set_figure()` and `.set_axes()` will be None (instead of `self`) to avoid misunderstandings.\n* New optional parameter `inplace=` for `PlotDataSet.set_plot()` to decide whether the changes will happen in-place (which is the only option before) or in a new copy.\n* Parameter `ticks=` for `PlotDataSet.plot()` can be set to a `PlotDataSet` object now.\n\n### v0.1.0\n* `PlotDataSet` now supports binary operations including +, -, *, /, and **.\n* New methods `FigWrapper.set_figure()` and `AxesWrapper.set_axes()` - use them instead of `*.set_plot()`.\n* Simplified the usage of `AxesWrapper`.\n* New plot settings: `subplots_adjust=`, `fontdict=` and `dpi=`.\n* After this version, the required Python version is updated to \u003e=3.11.9. Download and install v0.0.2 if the user is under lower Python version (\u003e=3.8.13).\n\n### v0.0.2\n* Updated the meta-data.\n\n### v0.0.1\n* Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchitaoji%2Fdataplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchitaoji%2Fdataplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchitaoji%2Fdataplot/lists"}