scitex 2.7.0__py3-none-any.whl → 2.8.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scitex/__init__.py +6 -2
- scitex/__version__.py +1 -1
- scitex/audio/README.md +52 -0
- scitex/audio/__init__.py +384 -0
- scitex/audio/__main__.py +129 -0
- scitex/audio/_tts.py +334 -0
- scitex/audio/engines/__init__.py +44 -0
- scitex/audio/engines/base.py +275 -0
- scitex/audio/engines/elevenlabs_engine.py +143 -0
- scitex/audio/engines/gtts_engine.py +162 -0
- scitex/audio/engines/pyttsx3_engine.py +131 -0
- scitex/audio/mcp_server.py +757 -0
- scitex/bridge/_helpers.py +1 -1
- scitex/bridge/_plt_vis.py +1 -1
- scitex/bridge/_stats_vis.py +1 -1
- scitex/dev/plt/__init__.py +272 -0
- scitex/dev/plt/plot_mpl_axhline.py +28 -0
- scitex/dev/plt/plot_mpl_axhspan.py +28 -0
- scitex/dev/plt/plot_mpl_axvline.py +28 -0
- scitex/dev/plt/plot_mpl_axvspan.py +28 -0
- scitex/dev/plt/plot_mpl_bar.py +29 -0
- scitex/dev/plt/plot_mpl_barh.py +29 -0
- scitex/dev/plt/plot_mpl_boxplot.py +28 -0
- scitex/dev/plt/plot_mpl_contour.py +31 -0
- scitex/dev/plt/plot_mpl_contourf.py +31 -0
- scitex/dev/plt/plot_mpl_errorbar.py +30 -0
- scitex/dev/plt/plot_mpl_eventplot.py +28 -0
- scitex/dev/plt/plot_mpl_fill.py +30 -0
- scitex/dev/plt/plot_mpl_fill_between.py +31 -0
- scitex/dev/plt/plot_mpl_hexbin.py +28 -0
- scitex/dev/plt/plot_mpl_hist.py +28 -0
- scitex/dev/plt/plot_mpl_hist2d.py +28 -0
- scitex/dev/plt/plot_mpl_imshow.py +29 -0
- scitex/dev/plt/plot_mpl_pcolormesh.py +31 -0
- scitex/dev/plt/plot_mpl_pie.py +29 -0
- scitex/dev/plt/plot_mpl_plot.py +29 -0
- scitex/dev/plt/plot_mpl_quiver.py +31 -0
- scitex/dev/plt/plot_mpl_scatter.py +28 -0
- scitex/dev/plt/plot_mpl_stackplot.py +31 -0
- scitex/dev/plt/plot_mpl_stem.py +29 -0
- scitex/dev/plt/plot_mpl_step.py +29 -0
- scitex/dev/plt/plot_mpl_violinplot.py +28 -0
- scitex/dev/plt/plot_sns_barplot.py +29 -0
- scitex/dev/plt/plot_sns_boxplot.py +29 -0
- scitex/dev/plt/plot_sns_heatmap.py +28 -0
- scitex/dev/plt/plot_sns_histplot.py +29 -0
- scitex/dev/plt/plot_sns_kdeplot.py +29 -0
- scitex/dev/plt/plot_sns_lineplot.py +31 -0
- scitex/dev/plt/plot_sns_scatterplot.py +29 -0
- scitex/dev/plt/plot_sns_stripplot.py +29 -0
- scitex/dev/plt/plot_sns_swarmplot.py +29 -0
- scitex/dev/plt/plot_sns_violinplot.py +29 -0
- scitex/dev/plt/plot_stx_bar.py +29 -0
- scitex/dev/plt/plot_stx_barh.py +29 -0
- scitex/dev/plt/plot_stx_box.py +28 -0
- scitex/dev/plt/plot_stx_boxplot.py +28 -0
- scitex/dev/plt/plot_stx_conf_mat.py +28 -0
- scitex/dev/plt/plot_stx_contour.py +31 -0
- scitex/dev/plt/plot_stx_ecdf.py +28 -0
- scitex/dev/plt/plot_stx_errorbar.py +30 -0
- scitex/dev/plt/plot_stx_fill_between.py +31 -0
- scitex/dev/plt/plot_stx_fillv.py +28 -0
- scitex/dev/plt/plot_stx_heatmap.py +28 -0
- scitex/dev/plt/plot_stx_image.py +28 -0
- scitex/dev/plt/plot_stx_imshow.py +28 -0
- scitex/dev/plt/plot_stx_joyplot.py +28 -0
- scitex/dev/plt/plot_stx_kde.py +28 -0
- scitex/dev/plt/plot_stx_line.py +28 -0
- scitex/dev/plt/plot_stx_mean_ci.py +28 -0
- scitex/dev/plt/plot_stx_mean_std.py +28 -0
- scitex/dev/plt/plot_stx_median_iqr.py +28 -0
- scitex/dev/plt/plot_stx_raster.py +28 -0
- scitex/dev/plt/plot_stx_rectangle.py +28 -0
- scitex/dev/plt/plot_stx_scatter.py +29 -0
- scitex/dev/plt/plot_stx_shaded_line.py +29 -0
- scitex/dev/plt/plot_stx_violin.py +28 -0
- scitex/dev/plt/plot_stx_violinplot.py +28 -0
- scitex/diagram/README.md +197 -0
- scitex/diagram/__init__.py +48 -0
- scitex/diagram/_compile.py +312 -0
- scitex/diagram/_diagram.py +355 -0
- scitex/diagram/_presets.py +173 -0
- scitex/diagram/_schema.py +182 -0
- scitex/diagram/_split.py +278 -0
- scitex/fig/__init__.py +352 -0
- scitex/{vis → fig}/backend/_parser.py +1 -1
- scitex/{vis → fig}/canvas.py +1 -1
- scitex/{vis → fig}/editor/__init__.py +5 -2
- scitex/{vis → fig}/editor/_dearpygui_editor.py +1 -1
- scitex/{vis → fig}/editor/_defaults.py +70 -5
- scitex/{vis → fig}/editor/_mpl_editor.py +1 -1
- scitex/{vis → fig}/editor/_qt_editor.py +182 -2
- scitex/{vis → fig}/editor/_tkinter_editor.py +1 -1
- scitex/fig/editor/edit/__init__.py +50 -0
- scitex/fig/editor/edit/backend_detector.py +109 -0
- scitex/fig/editor/edit/bundle_resolver.py +240 -0
- scitex/fig/editor/edit/editor_launcher.py +239 -0
- scitex/fig/editor/edit/manual_handler.py +53 -0
- scitex/fig/editor/edit/panel_loader.py +232 -0
- scitex/fig/editor/edit/path_resolver.py +67 -0
- scitex/fig/editor/flask_editor/_bbox.py +1299 -0
- scitex/fig/editor/flask_editor/_core.py +1429 -0
- scitex/{vis → fig}/editor/flask_editor/_plotter.py +38 -4
- scitex/fig/editor/flask_editor/_renderer.py +813 -0
- scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
- scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
- scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
- scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
- scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
- scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
- scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
- scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
- scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
- scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
- scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
- scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
- scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
- scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
- scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
- scitex/fig/editor/flask_editor/static/css/index.css +31 -0
- scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
- scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
- scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
- scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
- scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
- scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
- scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
- scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
- scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
- scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
- scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
- scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
- scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
- scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
- scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
- scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
- scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
- scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
- scitex/fig/editor/flask_editor/static/js/main.js +426 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
- scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
- scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
- scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
- scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
- scitex/fig/editor/flask_editor/templates/__init__.py +123 -0
- scitex/fig/editor/flask_editor/templates/_html.py +852 -0
- scitex/fig/editor/flask_editor/templates/_scripts.py +4933 -0
- scitex/fig/editor/flask_editor/templates/_styles.py +1658 -0
- scitex/{vis → fig}/io/__init__.py +13 -1
- scitex/fig/io/_bundle.py +1058 -0
- scitex/{vis → fig}/io/_canvas.py +1 -1
- scitex/{vis → fig}/io/_data.py +1 -1
- scitex/{vis → fig}/io/_export.py +1 -1
- scitex/{vis → fig}/io/_load.py +1 -1
- scitex/{vis → fig}/io/_panel.py +1 -1
- scitex/{vis → fig}/io/_save.py +1 -1
- scitex/{vis → fig}/model/__init__.py +1 -1
- scitex/{vis → fig}/model/_annotations.py +1 -1
- scitex/{vis → fig}/model/_axes.py +1 -1
- scitex/{vis → fig}/model/_figure.py +1 -1
- scitex/{vis → fig}/model/_guides.py +1 -1
- scitex/{vis → fig}/model/_plot.py +1 -1
- scitex/{vis → fig}/model/_styles.py +1 -1
- scitex/{vis → fig}/utils/__init__.py +1 -1
- scitex/io/__init__.py +22 -26
- scitex/io/_bundle.py +493 -0
- scitex/io/_flush.py +5 -2
- scitex/io/_load.py +98 -0
- scitex/io/_load_modules/_H5Explorer.py +5 -2
- scitex/io/_load_modules/_canvas.py +2 -2
- scitex/io/_load_modules/_image.py +3 -4
- scitex/io/_load_modules/_txt.py +4 -2
- scitex/io/_metadata.py +34 -324
- scitex/io/_metadata_modules/__init__.py +46 -0
- scitex/io/_metadata_modules/_embed.py +70 -0
- scitex/io/_metadata_modules/_read.py +64 -0
- scitex/io/_metadata_modules/_utils.py +79 -0
- scitex/io/_metadata_modules/embed_metadata_jpeg.py +74 -0
- scitex/io/_metadata_modules/embed_metadata_pdf.py +53 -0
- scitex/io/_metadata_modules/embed_metadata_png.py +26 -0
- scitex/io/_metadata_modules/embed_metadata_svg.py +62 -0
- scitex/io/_metadata_modules/read_metadata_jpeg.py +57 -0
- scitex/io/_metadata_modules/read_metadata_pdf.py +51 -0
- scitex/io/_metadata_modules/read_metadata_png.py +39 -0
- scitex/io/_metadata_modules/read_metadata_svg.py +44 -0
- scitex/io/_qr_utils.py +5 -3
- scitex/io/_save.py +548 -30
- scitex/io/_save_modules/_canvas.py +3 -3
- scitex/io/_save_modules/_image.py +5 -9
- scitex/io/_save_modules/_tex.py +7 -4
- scitex/io/_zip_bundle.py +439 -0
- scitex/io/utils/h5_to_zarr.py +11 -9
- scitex/msword/__init__.py +255 -0
- scitex/msword/profiles.py +357 -0
- scitex/msword/reader.py +753 -0
- scitex/msword/utils.py +289 -0
- scitex/msword/writer.py +362 -0
- scitex/plt/__init__.py +5 -2
- scitex/plt/_subplots/_AxesWrapper.py +6 -6
- scitex/plt/_subplots/_AxisWrapper.py +15 -9
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +36 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +264 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +213 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +128 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +59 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +34 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +593 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +654 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +527 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +321 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +33 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +152 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +600 -0
- scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +79 -5
- scitex/plt/_subplots/_FigWrapper.py +6 -6
- scitex/plt/_subplots/_SubplotsWrapper.py +28 -18
- scitex/plt/_subplots/_export_as_csv.py +35 -5
- scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +8 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_annotate.py +10 -21
- scitex/plt/_subplots/_export_as_csv_formatters/_format_eventplot.py +18 -7
- scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py +28 -12
- scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py +10 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_imshow.py +13 -1
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_kde.py +12 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_scatter.py +10 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_quiver.py +10 -4
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_jointplot.py +18 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_lineplot.py +44 -36
- scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_pairplot.py +14 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_streamplot.py +11 -5
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +84 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +85 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_conf_mat.py +14 -3
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_contour.py +54 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_ecdf.py +14 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +120 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_heatmap.py +16 -6
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_image.py +29 -19
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_imshow.py +63 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_joyplot.py +22 -5
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py +18 -14
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_raster.py +10 -2
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +51 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter_hist.py +18 -9
- scitex/plt/ax/_plot/_stx_ecdf.py +4 -2
- scitex/plt/gallery/_generate.py +421 -14
- scitex/plt/io/__init__.py +53 -0
- scitex/plt/io/_bundle.py +490 -0
- scitex/plt/io/_layered_bundle.py +1343 -0
- scitex/plt/styles/SCITEX_STYLE.yaml +26 -0
- scitex/plt/styles/__init__.py +14 -0
- scitex/plt/styles/presets.py +78 -0
- scitex/plt/utils/__init__.py +13 -1
- scitex/plt/utils/_collect_figure_metadata.py +10 -14
- scitex/plt/utils/_configure_mpl.py +6 -18
- scitex/plt/utils/_crop.py +32 -14
- scitex/plt/utils/_csv_column_naming.py +54 -0
- scitex/plt/utils/_figure_mm.py +116 -1
- scitex/plt/utils/_hitmap.py +1643 -0
- scitex/plt/utils/metadata/__init__.py +25 -0
- scitex/plt/utils/metadata/_core.py +9 -10
- scitex/plt/utils/metadata/_dimensions.py +6 -3
- scitex/plt/utils/metadata/_editable_export.py +405 -0
- scitex/plt/utils/metadata/_geometry_extraction.py +570 -0
- scitex/schema/__init__.py +109 -16
- scitex/schema/_canvas.py +1 -1
- scitex/schema/_plot.py +1015 -0
- scitex/schema/_stats.py +2 -2
- scitex/stats/__init__.py +117 -0
- scitex/stats/io/__init__.py +29 -0
- scitex/stats/io/_bundle.py +156 -0
- scitex/tex/__init__.py +4 -0
- scitex/tex/_export.py +890 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/METADATA +11 -1
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/RECORD +294 -170
- scitex/io/memo.md +0 -2827
- scitex/plt/REQUESTS.md +0 -191
- scitex/plt/_subplots/TODO.md +0 -53
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin.py +0 -559
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py +0 -1609
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin.py +0 -447
- scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_between.json +0 -110
- scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_betweenx.json +0 -88
- scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fill_between.json +0 -103
- scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fillv.json +0 -106
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/bar.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/barh.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/boxplot.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_bar.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_barh.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_box.json +0 -83
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_boxplot.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violin.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violinplot.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/categorical/violinplot.json +0 -91
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/contour.json +0 -97
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/contourf.json +0 -98
- scitex/plt/templates/research-master/scitex/vis/gallery/contour/stx_contour.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist.json +0 -101
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist2d.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_ecdf.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_joyplot.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_kde.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/imshow.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/matshow.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_conf_mat.json +0 -83
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_heatmap.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_image.json +0 -121
- scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_imshow.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/line/plot.json +0 -110
- scitex/plt/templates/research-master/scitex/vis/gallery/line/step.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_line.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_shaded_line.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/hexbin.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/scatter.json +0 -95
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stem.json +0 -92
- scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stx_scatter.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/special/pie.json +0 -94
- scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_raster.json +0 -109
- scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_rectangle.json +0 -108
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/errorbar.json +0 -93
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_errorbar.json +0 -84
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_ci.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_std.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_median_iqr.json +0 -96
- scitex/plt/templates/research-master/scitex/vis/gallery/vector/quiver.json +0 -99
- scitex/plt/templates/research-master/scitex/vis/gallery/vector/streamplot.json +0 -100
- scitex/vis/__init__.py +0 -177
- scitex/vis/editor/_edit.py +0 -390
- scitex/vis/editor/flask_editor/_bbox.py +0 -529
- scitex/vis/editor/flask_editor/_core.py +0 -168
- scitex/vis/editor/flask_editor/_renderer.py +0 -393
- scitex/vis/editor/flask_editor/templates/__init__.py +0 -33
- scitex/vis/editor/flask_editor/templates/_html.py +0 -513
- scitex/vis/editor/flask_editor/templates/_scripts.py +0 -1261
- scitex/vis/editor/flask_editor/templates/_styles.py +0 -739
- /scitex/{vis → fig}/README.md +0 -0
- /scitex/{vis → fig}/backend/__init__.py +0 -0
- /scitex/{vis → fig}/backend/_export.py +0 -0
- /scitex/{vis → fig}/backend/_render.py +0 -0
- /scitex/{vis → fig}/docs/CANVAS_ARCHITECTURE.md +0 -0
- /scitex/{vis → fig}/editor/_flask_editor.py +0 -0
- /scitex/{vis → fig}/editor/flask_editor/__init__.py +0 -0
- /scitex/{vis → fig}/editor/flask_editor/_utils.py +0 -0
- /scitex/{vis → fig}/io/_directory.py +0 -0
- /scitex/{vis → fig}/model/_plot_types.py +0 -0
- /scitex/{vis → fig}/utils/_defaults.py +0 -0
- /scitex/{vis → fig}/utils/_validate.py +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/WHEEL +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/entry_points.txt +0 -0
- {scitex-2.7.0.dist-info → scitex-2.8.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
|
+
# File: __init__.py - MatplotlibPlotMixin package
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
MatplotlibPlotMixin - Modular plotting mixin for AxisWrapper.
|
|
8
|
+
|
|
9
|
+
This package provides plotting functionality split into logical submodules:
|
|
10
|
+
- _base: Core helper methods
|
|
11
|
+
- _scientific: Scientific/specialized plots (stx_image, stx_kde, stx_conf_mat, etc.)
|
|
12
|
+
- _statistical: Statistical plots (stx_line, stx_mean_std, stx_box, stx_violin, hist)
|
|
13
|
+
- _stx_aliases: stx_ prefixed aliases for standard matplotlib methods
|
|
14
|
+
|
|
15
|
+
API Layer Design:
|
|
16
|
+
-----------------
|
|
17
|
+
stx_* (SciTeX canonical):
|
|
18
|
+
- Full tracking, metadata, and reproducibility support
|
|
19
|
+
- Output connects to .pltz / .figz format
|
|
20
|
+
- Purpose: publication / reproducibility
|
|
21
|
+
|
|
22
|
+
mpl_* (Matplotlib compatibility - see _RawMatplotlibMixin):
|
|
23
|
+
- Raw matplotlib API without scitex processing
|
|
24
|
+
- Purpose: compatibility / low-level control / escape hatch
|
|
25
|
+
|
|
26
|
+
sns_* (Seaborn - see _SeabornMixin):
|
|
27
|
+
- DataFrame-centric with data=, x=, y=, hue= interface
|
|
28
|
+
- Purpose: exploratory / grouped stats
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
import os
|
|
32
|
+
|
|
33
|
+
__FILE__ = __file__
|
|
34
|
+
__DIR__ = os.path.dirname(__FILE__)
|
|
35
|
+
|
|
36
|
+
from ._base import PlotBaseMixin
|
|
37
|
+
from ._scientific import ScientificPlotMixin
|
|
38
|
+
from ._statistical import StatisticalPlotMixin
|
|
39
|
+
from ._stx_aliases import StxAliasesMixin
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class MatplotlibPlotMixin(
|
|
43
|
+
PlotBaseMixin,
|
|
44
|
+
ScientificPlotMixin,
|
|
45
|
+
StatisticalPlotMixin,
|
|
46
|
+
StxAliasesMixin,
|
|
47
|
+
):
|
|
48
|
+
"""Mixin class for basic plotting operations.
|
|
49
|
+
|
|
50
|
+
Combines multiple specialized mixins:
|
|
51
|
+
- PlotBaseMixin: Core helper methods (_get_ax_module, _apply_scitex_postprocess)
|
|
52
|
+
- ScientificPlotMixin: Scientific plots (stx_image, stx_kde, stx_conf_mat, etc.)
|
|
53
|
+
- StatisticalPlotMixin: Statistical line plots and distributions
|
|
54
|
+
- StxAliasesMixin: stx_ prefixed matplotlib aliases
|
|
55
|
+
"""
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# EOF
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
|
+
# File: _base.py - Core helper methods for MatplotlibPlotMixin
|
|
5
|
+
|
|
6
|
+
"""Base mixin with core helper methods for plotting."""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
|
|
10
|
+
__FILE__ = __file__
|
|
11
|
+
__DIR__ = os.path.dirname(__FILE__)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PlotBaseMixin:
|
|
15
|
+
"""Base mixin with core helper methods for plotting."""
|
|
16
|
+
|
|
17
|
+
def _get_ax_module(self):
|
|
18
|
+
"""Lazy import ax module to avoid circular imports."""
|
|
19
|
+
from .....plt import ax as ax_module
|
|
20
|
+
return ax_module
|
|
21
|
+
|
|
22
|
+
def _apply_scitex_postprocess(
|
|
23
|
+
self, method_name, result=None, kwargs=None, args=None
|
|
24
|
+
):
|
|
25
|
+
"""Apply scitex post-processing styling after plotting.
|
|
26
|
+
|
|
27
|
+
This ensures all scitex wrapper methods get the same styling
|
|
28
|
+
as matplotlib methods going through __getattr__ (tick locator, spines, etc.).
|
|
29
|
+
"""
|
|
30
|
+
from scitex.plt.styles import apply_plot_postprocess
|
|
31
|
+
apply_plot_postprocess(method_name, result, self._axis_mpl, kwargs or {}, args)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# EOF
|
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Timestamp: "2025-12-13 (ywatanabe)"
|
|
4
|
+
# File: _scientific.py - Scientific/specialized plot methods
|
|
5
|
+
|
|
6
|
+
"""Scientific and domain-specific plotting methods."""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
from typing import Any, Dict, List, Optional, Tuple
|
|
10
|
+
|
|
11
|
+
import matplotlib
|
|
12
|
+
import numpy as np
|
|
13
|
+
import pandas as pd
|
|
14
|
+
from scipy.stats import gaussian_kde
|
|
15
|
+
|
|
16
|
+
from scitex.pd import to_xyz
|
|
17
|
+
from scitex.types import ArrayLike
|
|
18
|
+
|
|
19
|
+
__FILE__ = __file__
|
|
20
|
+
__DIR__ = os.path.dirname(__FILE__)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ScientificPlotMixin:
|
|
24
|
+
"""Mixin for scientific and domain-specific plotting methods.
|
|
25
|
+
|
|
26
|
+
Provides specialized visualizations for:
|
|
27
|
+
- Image display with colorbars
|
|
28
|
+
- Kernel density estimation
|
|
29
|
+
- Confusion matrices
|
|
30
|
+
- Raster plots (spike trains)
|
|
31
|
+
- ECDF plots
|
|
32
|
+
- Joint distributions (scatter + marginal histograms)
|
|
33
|
+
- Heatmaps with annotations
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def stx_image(
|
|
37
|
+
self,
|
|
38
|
+
data: ArrayLike,
|
|
39
|
+
*,
|
|
40
|
+
track: bool = True,
|
|
41
|
+
id: Optional[str] = None,
|
|
42
|
+
**kwargs,
|
|
43
|
+
) -> "Axes":
|
|
44
|
+
"""Display a 2D array as an image with SciTeX styling.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
data : array-like
|
|
49
|
+
2D array to display as an image.
|
|
50
|
+
track : bool, default True
|
|
51
|
+
Enable data tracking for reproducibility.
|
|
52
|
+
id : str, optional
|
|
53
|
+
Unique identifier for this plot element.
|
|
54
|
+
**kwargs
|
|
55
|
+
Additional arguments passed to the image function.
|
|
56
|
+
Common options: cmap, vmin, vmax, aspect, colorbar.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
Axes
|
|
61
|
+
The axes with the image displayed.
|
|
62
|
+
|
|
63
|
+
See Also
|
|
64
|
+
--------
|
|
65
|
+
stx_imshow : Lower-level image display.
|
|
66
|
+
stx_heatmap : Annotated heatmap.
|
|
67
|
+
sns_heatmap : DataFrame-based heatmap.
|
|
68
|
+
|
|
69
|
+
Examples
|
|
70
|
+
--------
|
|
71
|
+
>>> ax.stx_image(matrix, cmap='viridis', colorbar=True)
|
|
72
|
+
"""
|
|
73
|
+
method_name = "stx_image"
|
|
74
|
+
|
|
75
|
+
with self._no_tracking():
|
|
76
|
+
self._axis_mpl = self._get_ax_module().stx_image(
|
|
77
|
+
self._axis_mpl, data, **kwargs
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
tracked_dict = {"image_df": pd.DataFrame(data)}
|
|
81
|
+
if kwargs.get("xyz", False):
|
|
82
|
+
tracked_dict["image_df"] = to_xyz(tracked_dict["image_df"])
|
|
83
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
84
|
+
self._apply_scitex_postprocess(method_name)
|
|
85
|
+
|
|
86
|
+
return self._axis_mpl
|
|
87
|
+
|
|
88
|
+
def stx_kde(
|
|
89
|
+
self,
|
|
90
|
+
data: ArrayLike,
|
|
91
|
+
*,
|
|
92
|
+
cumulative: bool = False,
|
|
93
|
+
fill: bool = False,
|
|
94
|
+
xlim: Optional[Tuple[float, float]] = None,
|
|
95
|
+
track: bool = True,
|
|
96
|
+
id: Optional[str] = None,
|
|
97
|
+
**kwargs,
|
|
98
|
+
) -> "Axes":
|
|
99
|
+
"""Plot a kernel density estimate of the data.
|
|
100
|
+
|
|
101
|
+
Parameters
|
|
102
|
+
----------
|
|
103
|
+
data : array-like
|
|
104
|
+
1D array of values for density estimation.
|
|
105
|
+
cumulative : bool, default False
|
|
106
|
+
If True, plot cumulative distribution instead of density.
|
|
107
|
+
fill : bool, default False
|
|
108
|
+
If True, fill the area under the curve.
|
|
109
|
+
xlim : tuple of float, optional
|
|
110
|
+
Range for the x-axis. If None, uses data range.
|
|
111
|
+
track : bool, default True
|
|
112
|
+
Enable data tracking for reproducibility.
|
|
113
|
+
id : str, optional
|
|
114
|
+
Unique identifier for this plot element.
|
|
115
|
+
**kwargs
|
|
116
|
+
Additional arguments passed to the plot function.
|
|
117
|
+
Common options: color, linewidth, linestyle, label.
|
|
118
|
+
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
Axes
|
|
122
|
+
The axes with the KDE plot.
|
|
123
|
+
|
|
124
|
+
See Also
|
|
125
|
+
--------
|
|
126
|
+
sns_kdeplot : DataFrame-based KDE plot.
|
|
127
|
+
stx_ecdf : Empirical cumulative distribution function.
|
|
128
|
+
hist : Histogram alternative.
|
|
129
|
+
|
|
130
|
+
Examples
|
|
131
|
+
--------
|
|
132
|
+
>>> ax.stx_kde(samples, fill=True, alpha=0.3)
|
|
133
|
+
>>> ax.stx_kde(data, cumulative=True, label='CDF')
|
|
134
|
+
"""
|
|
135
|
+
method_name = "stx_kde"
|
|
136
|
+
|
|
137
|
+
n_samples = (~np.isnan(data)).sum()
|
|
138
|
+
if kwargs.get("label"):
|
|
139
|
+
kwargs["label"] = f"{kwargs['label']} ($n$={n_samples})"
|
|
140
|
+
|
|
141
|
+
if xlim is None:
|
|
142
|
+
xlim = (np.nanmin(data), np.nanmax(data))
|
|
143
|
+
|
|
144
|
+
xx = np.linspace(xlim[0], xlim[1], int(1e3))
|
|
145
|
+
density = gaussian_kde(data)(xx)
|
|
146
|
+
density /= density.sum()
|
|
147
|
+
|
|
148
|
+
if cumulative:
|
|
149
|
+
density = np.cumsum(density)
|
|
150
|
+
|
|
151
|
+
with self._no_tracking():
|
|
152
|
+
from scitex.plt.utils import mm_to_pt
|
|
153
|
+
|
|
154
|
+
if "linewidth" not in kwargs and "lw" not in kwargs:
|
|
155
|
+
kwargs["linewidth"] = mm_to_pt(0.2)
|
|
156
|
+
if "color" not in kwargs and "c" not in kwargs:
|
|
157
|
+
kwargs["color"] = "black"
|
|
158
|
+
if "linestyle" not in kwargs and "ls" not in kwargs:
|
|
159
|
+
kwargs["linestyle"] = "--"
|
|
160
|
+
|
|
161
|
+
if fill:
|
|
162
|
+
self._axis_mpl.fill_between(xx, density, **kwargs)
|
|
163
|
+
else:
|
|
164
|
+
self._axis_mpl.plot(xx, density, **kwargs)
|
|
165
|
+
|
|
166
|
+
tracked_dict = {"x": xx, "kde": density, "n": n_samples}
|
|
167
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
168
|
+
self._apply_scitex_postprocess(method_name)
|
|
169
|
+
|
|
170
|
+
return self._axis_mpl
|
|
171
|
+
|
|
172
|
+
def stx_conf_mat(
|
|
173
|
+
self,
|
|
174
|
+
data: ArrayLike,
|
|
175
|
+
*,
|
|
176
|
+
x_labels: Optional[List[str]] = None,
|
|
177
|
+
y_labels: Optional[List[str]] = None,
|
|
178
|
+
title: str = "Confusion Matrix",
|
|
179
|
+
cmap: str = "Blues",
|
|
180
|
+
cbar: bool = True,
|
|
181
|
+
cbar_kw: Optional[Dict[str, Any]] = None,
|
|
182
|
+
label_rotation_xy: Tuple[float, float] = (15, 15),
|
|
183
|
+
x_extend_ratio: float = 1.0,
|
|
184
|
+
y_extend_ratio: float = 1.0,
|
|
185
|
+
calc_bacc: bool = False,
|
|
186
|
+
track: bool = True,
|
|
187
|
+
id: Optional[str] = None,
|
|
188
|
+
**kwargs,
|
|
189
|
+
) -> Tuple["Axes", Optional[float]]:
|
|
190
|
+
"""Plot a confusion matrix with optional balanced accuracy calculation.
|
|
191
|
+
|
|
192
|
+
Parameters
|
|
193
|
+
----------
|
|
194
|
+
data : array-like
|
|
195
|
+
2D confusion matrix array.
|
|
196
|
+
x_labels : list of str, optional
|
|
197
|
+
Labels for x-axis (predicted classes).
|
|
198
|
+
y_labels : list of str, optional
|
|
199
|
+
Labels for y-axis (true classes).
|
|
200
|
+
title : str, default 'Confusion Matrix'
|
|
201
|
+
Title for the plot.
|
|
202
|
+
cmap : str, default 'Blues'
|
|
203
|
+
Colormap for the heatmap.
|
|
204
|
+
cbar : bool, default True
|
|
205
|
+
Whether to show the colorbar.
|
|
206
|
+
cbar_kw : dict, optional
|
|
207
|
+
Additional keyword arguments for the colorbar.
|
|
208
|
+
label_rotation_xy : tuple of float, default (15, 15)
|
|
209
|
+
Rotation angles for (x, y) axis labels.
|
|
210
|
+
x_extend_ratio : float, default 1.0
|
|
211
|
+
Ratio to extend x-axis limits.
|
|
212
|
+
y_extend_ratio : float, default 1.0
|
|
213
|
+
Ratio to extend y-axis limits.
|
|
214
|
+
calc_bacc : bool, default False
|
|
215
|
+
Whether to calculate and return balanced accuracy.
|
|
216
|
+
track : bool, default True
|
|
217
|
+
Enable data tracking for reproducibility.
|
|
218
|
+
id : str, optional
|
|
219
|
+
Unique identifier for this plot element.
|
|
220
|
+
**kwargs
|
|
221
|
+
Additional arguments passed to the heatmap function.
|
|
222
|
+
|
|
223
|
+
Returns
|
|
224
|
+
-------
|
|
225
|
+
tuple
|
|
226
|
+
(Axes, balanced_accuracy) - balanced_accuracy is None if calc_bacc=False.
|
|
227
|
+
|
|
228
|
+
Examples
|
|
229
|
+
--------
|
|
230
|
+
>>> ax.stx_conf_mat(cm, x_labels=['A', 'B'], y_labels=['A', 'B'])
|
|
231
|
+
>>> ax, bacc = ax.stx_conf_mat(cm, calc_bacc=True)
|
|
232
|
+
"""
|
|
233
|
+
method_name = "stx_conf_mat"
|
|
234
|
+
|
|
235
|
+
if cbar_kw is None:
|
|
236
|
+
cbar_kw = {}
|
|
237
|
+
|
|
238
|
+
with self._no_tracking():
|
|
239
|
+
self._axis_mpl, bacc_val = self._get_ax_module().stx_conf_mat(
|
|
240
|
+
self._axis_mpl,
|
|
241
|
+
data,
|
|
242
|
+
x_labels=x_labels,
|
|
243
|
+
y_labels=y_labels,
|
|
244
|
+
title=title,
|
|
245
|
+
cmap=cmap,
|
|
246
|
+
cbar=cbar,
|
|
247
|
+
cbar_kw=cbar_kw,
|
|
248
|
+
label_rotation_xy=label_rotation_xy,
|
|
249
|
+
x_extend_ratio=x_extend_ratio,
|
|
250
|
+
y_extend_ratio=y_extend_ratio,
|
|
251
|
+
calc_bacc=calc_bacc,
|
|
252
|
+
**kwargs,
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
tracked_dict = {
|
|
256
|
+
"args": [data],
|
|
257
|
+
"balanced_accuracy": bacc_val,
|
|
258
|
+
"x_labels": x_labels,
|
|
259
|
+
"y_labels": y_labels,
|
|
260
|
+
}
|
|
261
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
262
|
+
self._apply_scitex_postprocess(method_name)
|
|
263
|
+
|
|
264
|
+
return self._axis_mpl, bacc_val
|
|
265
|
+
|
|
266
|
+
def stx_raster(
|
|
267
|
+
self,
|
|
268
|
+
spike_times: List[ArrayLike],
|
|
269
|
+
*,
|
|
270
|
+
time: Optional[ArrayLike] = None,
|
|
271
|
+
labels: Optional[List[str]] = None,
|
|
272
|
+
colors: Optional[List[str]] = None,
|
|
273
|
+
track: bool = True,
|
|
274
|
+
id: Optional[str] = None,
|
|
275
|
+
**kwargs,
|
|
276
|
+
) -> Tuple["Axes", pd.DataFrame]:
|
|
277
|
+
"""Plot a raster plot (spike train visualization).
|
|
278
|
+
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
spike_times : list of array-like
|
|
282
|
+
List of arrays, each containing spike times for one unit/neuron.
|
|
283
|
+
time : array-like, optional
|
|
284
|
+
Time axis reference. If None, uses spike time range.
|
|
285
|
+
labels : list of str, optional
|
|
286
|
+
Labels for each unit/row.
|
|
287
|
+
colors : list of str, optional
|
|
288
|
+
Colors for each unit/row.
|
|
289
|
+
track : bool, default True
|
|
290
|
+
Enable data tracking for reproducibility.
|
|
291
|
+
id : str, optional
|
|
292
|
+
Unique identifier for this plot element.
|
|
293
|
+
**kwargs
|
|
294
|
+
Additional arguments passed to the raster function.
|
|
295
|
+
|
|
296
|
+
Returns
|
|
297
|
+
-------
|
|
298
|
+
tuple
|
|
299
|
+
(Axes, DataFrame) - The axes and digitized raster data.
|
|
300
|
+
|
|
301
|
+
Examples
|
|
302
|
+
--------
|
|
303
|
+
>>> ax.stx_raster([spikes_unit1, spikes_unit2], labels=['Unit 1', 'Unit 2'])
|
|
304
|
+
"""
|
|
305
|
+
method_name = "stx_raster"
|
|
306
|
+
|
|
307
|
+
with self._no_tracking():
|
|
308
|
+
self._axis_mpl, raster_digit_df = self._get_ax_module().stx_raster(
|
|
309
|
+
self._axis_mpl, spike_times, time=time
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
tracked_dict = {"raster_digit_df": raster_digit_df}
|
|
313
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
314
|
+
self._apply_scitex_postprocess(method_name)
|
|
315
|
+
|
|
316
|
+
return self._axis_mpl, raster_digit_df
|
|
317
|
+
|
|
318
|
+
def stx_ecdf(
|
|
319
|
+
self,
|
|
320
|
+
data: ArrayLike,
|
|
321
|
+
*,
|
|
322
|
+
track: bool = True,
|
|
323
|
+
id: Optional[str] = None,
|
|
324
|
+
**kwargs,
|
|
325
|
+
) -> Tuple["Axes", pd.DataFrame]:
|
|
326
|
+
"""Plot an empirical cumulative distribution function (ECDF).
|
|
327
|
+
|
|
328
|
+
Parameters
|
|
329
|
+
----------
|
|
330
|
+
data : array-like
|
|
331
|
+
1D array of values.
|
|
332
|
+
track : bool, default True
|
|
333
|
+
Enable data tracking for reproducibility.
|
|
334
|
+
id : str, optional
|
|
335
|
+
Unique identifier for this plot element.
|
|
336
|
+
**kwargs
|
|
337
|
+
Additional arguments passed to the ECDF function.
|
|
338
|
+
Common options: color, linewidth, label.
|
|
339
|
+
|
|
340
|
+
Returns
|
|
341
|
+
-------
|
|
342
|
+
tuple
|
|
343
|
+
(Axes, DataFrame) - The axes and ECDF data (x, y columns).
|
|
344
|
+
|
|
345
|
+
See Also
|
|
346
|
+
--------
|
|
347
|
+
stx_kde : Kernel density estimate (continuous).
|
|
348
|
+
hist : Histogram (discrete bins).
|
|
349
|
+
|
|
350
|
+
Examples
|
|
351
|
+
--------
|
|
352
|
+
>>> ax.stx_ecdf(samples, label='Distribution A')
|
|
353
|
+
"""
|
|
354
|
+
method_name = "stx_ecdf"
|
|
355
|
+
|
|
356
|
+
with self._no_tracking():
|
|
357
|
+
self._axis_mpl, ecdf_df = self._get_ax_module().stx_ecdf(
|
|
358
|
+
self._axis_mpl, data, **kwargs
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
tracked_dict = {"ecdf_df": ecdf_df}
|
|
362
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
363
|
+
self._apply_scitex_postprocess(method_name)
|
|
364
|
+
|
|
365
|
+
return self._axis_mpl, ecdf_df
|
|
366
|
+
|
|
367
|
+
def stx_joyplot(
|
|
368
|
+
self,
|
|
369
|
+
data: ArrayLike,
|
|
370
|
+
*,
|
|
371
|
+
track: bool = True,
|
|
372
|
+
id: Optional[str] = None,
|
|
373
|
+
**kwargs,
|
|
374
|
+
) -> "Axes":
|
|
375
|
+
"""Plot a joyplot (ridgeline plot) for distribution comparison.
|
|
376
|
+
|
|
377
|
+
Parameters
|
|
378
|
+
----------
|
|
379
|
+
data : array-like
|
|
380
|
+
2D array where each row is a distribution to plot.
|
|
381
|
+
track : bool, default True
|
|
382
|
+
Enable data tracking for reproducibility.
|
|
383
|
+
id : str, optional
|
|
384
|
+
Unique identifier for this plot element.
|
|
385
|
+
**kwargs
|
|
386
|
+
Additional arguments passed to the joyplot function.
|
|
387
|
+
|
|
388
|
+
Returns
|
|
389
|
+
-------
|
|
390
|
+
Axes
|
|
391
|
+
The axes with the joyplot.
|
|
392
|
+
|
|
393
|
+
Examples
|
|
394
|
+
--------
|
|
395
|
+
>>> ax.stx_joyplot(distributions_2d, overlap=0.5)
|
|
396
|
+
"""
|
|
397
|
+
method_name = "stx_joyplot"
|
|
398
|
+
|
|
399
|
+
with self._no_tracking():
|
|
400
|
+
self._axis_mpl = self._get_ax_module().stx_joyplot(
|
|
401
|
+
self._axis_mpl, data, **kwargs
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
tracked_dict = {"joyplot_data": data}
|
|
405
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
406
|
+
self._apply_scitex_postprocess(method_name)
|
|
407
|
+
|
|
408
|
+
return self._axis_mpl
|
|
409
|
+
|
|
410
|
+
def stx_scatter_hist(
|
|
411
|
+
self,
|
|
412
|
+
x: ArrayLike,
|
|
413
|
+
y: ArrayLike,
|
|
414
|
+
*,
|
|
415
|
+
hist_bins: int = 20,
|
|
416
|
+
scatter_alpha: float = 0.6,
|
|
417
|
+
scatter_size: float = 20,
|
|
418
|
+
scatter_color: str = "blue",
|
|
419
|
+
hist_color_x: str = "blue",
|
|
420
|
+
hist_color_y: str = "red",
|
|
421
|
+
hist_alpha: float = 0.5,
|
|
422
|
+
scatter_ratio: float = 0.8,
|
|
423
|
+
track: bool = True,
|
|
424
|
+
id: Optional[str] = None,
|
|
425
|
+
**kwargs,
|
|
426
|
+
) -> Tuple["Axes", "Axes", "Axes", Dict]:
|
|
427
|
+
"""Plot a scatter plot with marginal histograms.
|
|
428
|
+
|
|
429
|
+
Parameters
|
|
430
|
+
----------
|
|
431
|
+
x : array-like
|
|
432
|
+
X coordinates of the scatter points.
|
|
433
|
+
y : array-like
|
|
434
|
+
Y coordinates of the scatter points.
|
|
435
|
+
hist_bins : int, default 20
|
|
436
|
+
Number of bins for the marginal histograms.
|
|
437
|
+
scatter_alpha : float, default 0.6
|
|
438
|
+
Transparency of scatter points.
|
|
439
|
+
scatter_size : float, default 20
|
|
440
|
+
Size of scatter points.
|
|
441
|
+
scatter_color : str, default 'blue'
|
|
442
|
+
Color of scatter points.
|
|
443
|
+
hist_color_x : str, default 'blue'
|
|
444
|
+
Color of x-marginal histogram.
|
|
445
|
+
hist_color_y : str, default 'red'
|
|
446
|
+
Color of y-marginal histogram.
|
|
447
|
+
hist_alpha : float, default 0.5
|
|
448
|
+
Transparency of histograms.
|
|
449
|
+
scatter_ratio : float, default 0.8
|
|
450
|
+
Ratio of scatter plot area to total area.
|
|
451
|
+
track : bool, default True
|
|
452
|
+
Enable data tracking for reproducibility.
|
|
453
|
+
id : str, optional
|
|
454
|
+
Unique identifier for this plot element.
|
|
455
|
+
**kwargs
|
|
456
|
+
Additional arguments passed to the scatter function.
|
|
457
|
+
|
|
458
|
+
Returns
|
|
459
|
+
-------
|
|
460
|
+
tuple
|
|
461
|
+
(main_ax, hist_x_ax, hist_y_ax, hist_data) - Axes and histogram data.
|
|
462
|
+
|
|
463
|
+
See Also
|
|
464
|
+
--------
|
|
465
|
+
stx_scatter : Simple scatter plot.
|
|
466
|
+
sns_jointplot : Seaborn joint plot.
|
|
467
|
+
|
|
468
|
+
Examples
|
|
469
|
+
--------
|
|
470
|
+
>>> ax, ax_hx, ax_hy, data = ax.stx_scatter_hist(x, y, hist_bins=30)
|
|
471
|
+
"""
|
|
472
|
+
method_name = "stx_scatter_hist"
|
|
473
|
+
|
|
474
|
+
with self._no_tracking():
|
|
475
|
+
self._axis_mpl, ax_histx, ax_histy, hist_data = (
|
|
476
|
+
self._get_ax_module().stx_scatter_hist(
|
|
477
|
+
self._axis_mpl,
|
|
478
|
+
x,
|
|
479
|
+
y,
|
|
480
|
+
hist_bins=hist_bins,
|
|
481
|
+
scatter_alpha=scatter_alpha,
|
|
482
|
+
scatter_size=scatter_size,
|
|
483
|
+
scatter_color=scatter_color,
|
|
484
|
+
hist_color_x=hist_color_x,
|
|
485
|
+
hist_color_y=hist_color_y,
|
|
486
|
+
hist_alpha=hist_alpha,
|
|
487
|
+
scatter_ratio=scatter_ratio,
|
|
488
|
+
**kwargs,
|
|
489
|
+
)
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
tracked_dict = {
|
|
493
|
+
"x": x,
|
|
494
|
+
"y": y,
|
|
495
|
+
"hist_x": hist_data["hist_x"],
|
|
496
|
+
"hist_y": hist_data["hist_y"],
|
|
497
|
+
"bin_edges_x": hist_data["bin_edges_x"],
|
|
498
|
+
"bin_edges_y": hist_data["bin_edges_y"],
|
|
499
|
+
}
|
|
500
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
501
|
+
self._apply_scitex_postprocess(method_name)
|
|
502
|
+
|
|
503
|
+
return self._axis_mpl, ax_histx, ax_histy, hist_data
|
|
504
|
+
|
|
505
|
+
def stx_heatmap(
|
|
506
|
+
self,
|
|
507
|
+
data: ArrayLike,
|
|
508
|
+
*,
|
|
509
|
+
x_labels: Optional[List[str]] = None,
|
|
510
|
+
y_labels: Optional[List[str]] = None,
|
|
511
|
+
cmap: str = "viridis",
|
|
512
|
+
cbar_label: str = "ColorBar Label",
|
|
513
|
+
value_format: str = "{x:.1f}",
|
|
514
|
+
show_annot: bool = True,
|
|
515
|
+
annot_color_lighter: str = "white",
|
|
516
|
+
annot_color_darker: str = "black",
|
|
517
|
+
track: bool = True,
|
|
518
|
+
id: Optional[str] = None,
|
|
519
|
+
**kwargs,
|
|
520
|
+
) -> Tuple["Axes", matplotlib.image.AxesImage, matplotlib.colorbar.Colorbar]:
|
|
521
|
+
"""Plot an annotated heatmap.
|
|
522
|
+
|
|
523
|
+
Parameters
|
|
524
|
+
----------
|
|
525
|
+
data : array-like
|
|
526
|
+
2D array of values to display.
|
|
527
|
+
x_labels : list of str, optional
|
|
528
|
+
Labels for x-axis (columns).
|
|
529
|
+
y_labels : list of str, optional
|
|
530
|
+
Labels for y-axis (rows).
|
|
531
|
+
cmap : str, default 'viridis'
|
|
532
|
+
Colormap name.
|
|
533
|
+
cbar_label : str, default 'ColorBar Label'
|
|
534
|
+
Label for the colorbar.
|
|
535
|
+
value_format : str, default '{x:.1f}'
|
|
536
|
+
Format string for cell annotations.
|
|
537
|
+
show_annot : bool, default True
|
|
538
|
+
Whether to show value annotations in cells.
|
|
539
|
+
annot_color_lighter : str, default 'white'
|
|
540
|
+
Annotation color for dark backgrounds.
|
|
541
|
+
annot_color_darker : str, default 'black'
|
|
542
|
+
Annotation color for light backgrounds.
|
|
543
|
+
track : bool, default True
|
|
544
|
+
Enable data tracking for reproducibility.
|
|
545
|
+
id : str, optional
|
|
546
|
+
Unique identifier for this plot element.
|
|
547
|
+
**kwargs
|
|
548
|
+
Additional arguments passed to the heatmap function.
|
|
549
|
+
|
|
550
|
+
Returns
|
|
551
|
+
-------
|
|
552
|
+
tuple
|
|
553
|
+
(Axes, AxesImage, Colorbar) - The axes, image, and colorbar objects.
|
|
554
|
+
|
|
555
|
+
See Also
|
|
556
|
+
--------
|
|
557
|
+
sns_heatmap : DataFrame-based heatmap.
|
|
558
|
+
stx_conf_mat : Confusion matrix heatmap.
|
|
559
|
+
stx_image : Simple image display.
|
|
560
|
+
|
|
561
|
+
Examples
|
|
562
|
+
--------
|
|
563
|
+
>>> ax, im, cbar = ax.stx_heatmap(matrix, x_labels=['A', 'B'], cmap='coolwarm')
|
|
564
|
+
"""
|
|
565
|
+
method_name = "stx_heatmap"
|
|
566
|
+
|
|
567
|
+
with self._no_tracking():
|
|
568
|
+
ax, im, cbar = self._get_ax_module().stx_heatmap(
|
|
569
|
+
self._axis_mpl,
|
|
570
|
+
data,
|
|
571
|
+
x_labels=x_labels,
|
|
572
|
+
y_labels=y_labels,
|
|
573
|
+
cmap=cmap,
|
|
574
|
+
cbar_label=cbar_label,
|
|
575
|
+
value_format=value_format,
|
|
576
|
+
show_annot=show_annot,
|
|
577
|
+
annot_color_lighter=annot_color_lighter,
|
|
578
|
+
annot_color_darker=annot_color_darker,
|
|
579
|
+
**kwargs,
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
tracked_dict = {
|
|
583
|
+
"data": data,
|
|
584
|
+
"x_labels": x_labels,
|
|
585
|
+
"y_labels": y_labels,
|
|
586
|
+
}
|
|
587
|
+
self._track(track, id, method_name, tracked_dict, None)
|
|
588
|
+
self._apply_scitex_postprocess(method_name)
|
|
589
|
+
|
|
590
|
+
return ax, im, cbar
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
# EOF
|