scitex 2.7.0__py3-none-any.whl → 2.7.3__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.
Files changed (297) hide show
  1. scitex/__init__.py +6 -2
  2. scitex/__version__.py +1 -1
  3. scitex/audio/README.md +52 -0
  4. scitex/audio/__init__.py +384 -0
  5. scitex/audio/__main__.py +129 -0
  6. scitex/audio/_tts.py +334 -0
  7. scitex/audio/engines/__init__.py +44 -0
  8. scitex/audio/engines/base.py +275 -0
  9. scitex/audio/engines/elevenlabs_engine.py +143 -0
  10. scitex/audio/engines/gtts_engine.py +162 -0
  11. scitex/audio/engines/pyttsx3_engine.py +131 -0
  12. scitex/audio/mcp_server.py +757 -0
  13. scitex/bridge/_helpers.py +1 -1
  14. scitex/bridge/_plt_vis.py +1 -1
  15. scitex/bridge/_stats_vis.py +1 -1
  16. scitex/dev/plt/__init__.py +272 -0
  17. scitex/dev/plt/plot_mpl_axhline.py +28 -0
  18. scitex/dev/plt/plot_mpl_axhspan.py +28 -0
  19. scitex/dev/plt/plot_mpl_axvline.py +28 -0
  20. scitex/dev/plt/plot_mpl_axvspan.py +28 -0
  21. scitex/dev/plt/plot_mpl_bar.py +29 -0
  22. scitex/dev/plt/plot_mpl_barh.py +29 -0
  23. scitex/dev/plt/plot_mpl_boxplot.py +28 -0
  24. scitex/dev/plt/plot_mpl_contour.py +31 -0
  25. scitex/dev/plt/plot_mpl_contourf.py +31 -0
  26. scitex/dev/plt/plot_mpl_errorbar.py +30 -0
  27. scitex/dev/plt/plot_mpl_eventplot.py +28 -0
  28. scitex/dev/plt/plot_mpl_fill.py +30 -0
  29. scitex/dev/plt/plot_mpl_fill_between.py +31 -0
  30. scitex/dev/plt/plot_mpl_hexbin.py +28 -0
  31. scitex/dev/plt/plot_mpl_hist.py +28 -0
  32. scitex/dev/plt/plot_mpl_hist2d.py +28 -0
  33. scitex/dev/plt/plot_mpl_imshow.py +29 -0
  34. scitex/dev/plt/plot_mpl_pcolormesh.py +31 -0
  35. scitex/dev/plt/plot_mpl_pie.py +29 -0
  36. scitex/dev/plt/plot_mpl_plot.py +29 -0
  37. scitex/dev/plt/plot_mpl_quiver.py +31 -0
  38. scitex/dev/plt/plot_mpl_scatter.py +28 -0
  39. scitex/dev/plt/plot_mpl_stackplot.py +31 -0
  40. scitex/dev/plt/plot_mpl_stem.py +29 -0
  41. scitex/dev/plt/plot_mpl_step.py +29 -0
  42. scitex/dev/plt/plot_mpl_violinplot.py +28 -0
  43. scitex/dev/plt/plot_sns_barplot.py +29 -0
  44. scitex/dev/plt/plot_sns_boxplot.py +29 -0
  45. scitex/dev/plt/plot_sns_heatmap.py +28 -0
  46. scitex/dev/plt/plot_sns_histplot.py +29 -0
  47. scitex/dev/plt/plot_sns_kdeplot.py +29 -0
  48. scitex/dev/plt/plot_sns_lineplot.py +31 -0
  49. scitex/dev/plt/plot_sns_scatterplot.py +29 -0
  50. scitex/dev/plt/plot_sns_stripplot.py +29 -0
  51. scitex/dev/plt/plot_sns_swarmplot.py +29 -0
  52. scitex/dev/plt/plot_sns_violinplot.py +29 -0
  53. scitex/dev/plt/plot_stx_bar.py +29 -0
  54. scitex/dev/plt/plot_stx_barh.py +29 -0
  55. scitex/dev/plt/plot_stx_box.py +28 -0
  56. scitex/dev/plt/plot_stx_boxplot.py +28 -0
  57. scitex/dev/plt/plot_stx_conf_mat.py +28 -0
  58. scitex/dev/plt/plot_stx_contour.py +31 -0
  59. scitex/dev/plt/plot_stx_ecdf.py +28 -0
  60. scitex/dev/plt/plot_stx_errorbar.py +30 -0
  61. scitex/dev/plt/plot_stx_fill_between.py +31 -0
  62. scitex/dev/plt/plot_stx_fillv.py +28 -0
  63. scitex/dev/plt/plot_stx_heatmap.py +28 -0
  64. scitex/dev/plt/plot_stx_image.py +28 -0
  65. scitex/dev/plt/plot_stx_imshow.py +28 -0
  66. scitex/dev/plt/plot_stx_joyplot.py +28 -0
  67. scitex/dev/plt/plot_stx_kde.py +28 -0
  68. scitex/dev/plt/plot_stx_line.py +28 -0
  69. scitex/dev/plt/plot_stx_mean_ci.py +28 -0
  70. scitex/dev/plt/plot_stx_mean_std.py +28 -0
  71. scitex/dev/plt/plot_stx_median_iqr.py +28 -0
  72. scitex/dev/plt/plot_stx_raster.py +28 -0
  73. scitex/dev/plt/plot_stx_rectangle.py +28 -0
  74. scitex/dev/plt/plot_stx_scatter.py +29 -0
  75. scitex/dev/plt/plot_stx_shaded_line.py +29 -0
  76. scitex/dev/plt/plot_stx_violin.py +28 -0
  77. scitex/dev/plt/plot_stx_violinplot.py +28 -0
  78. scitex/fig/__init__.py +352 -0
  79. scitex/{vis → fig}/backend/_parser.py +1 -1
  80. scitex/{vis → fig}/canvas.py +1 -1
  81. scitex/{vis → fig}/editor/_defaults.py +70 -5
  82. scitex/fig/editor/_edit.py +751 -0
  83. scitex/{vis → fig}/editor/_qt_editor.py +181 -1
  84. scitex/fig/editor/flask_editor/_bbox.py +1276 -0
  85. scitex/fig/editor/flask_editor/_core.py +624 -0
  86. scitex/{vis → fig}/editor/flask_editor/_plotter.py +38 -4
  87. scitex/fig/editor/flask_editor/_renderer.py +739 -0
  88. scitex/{vis → fig}/editor/flask_editor/templates/__init__.py +1 -1
  89. scitex/fig/editor/flask_editor/templates/_html.py +834 -0
  90. scitex/fig/editor/flask_editor/templates/_scripts.py +3136 -0
  91. scitex/{vis → fig}/editor/flask_editor/templates/_styles.py +625 -18
  92. scitex/{vis → fig}/io/__init__.py +13 -1
  93. scitex/fig/io/_bundle.py +973 -0
  94. scitex/{vis → fig}/io/_canvas.py +1 -1
  95. scitex/{vis → fig}/io/_data.py +1 -1
  96. scitex/{vis → fig}/io/_export.py +1 -1
  97. scitex/{vis → fig}/io/_load.py +1 -1
  98. scitex/{vis → fig}/io/_panel.py +1 -1
  99. scitex/{vis → fig}/io/_save.py +1 -1
  100. scitex/{vis → fig}/model/__init__.py +1 -1
  101. scitex/{vis → fig}/model/_annotations.py +1 -1
  102. scitex/{vis → fig}/model/_axes.py +1 -1
  103. scitex/{vis → fig}/model/_figure.py +1 -1
  104. scitex/{vis → fig}/model/_guides.py +1 -1
  105. scitex/{vis → fig}/model/_plot.py +1 -1
  106. scitex/{vis → fig}/model/_styles.py +1 -1
  107. scitex/{vis → fig}/utils/__init__.py +1 -1
  108. scitex/io/__init__.py +10 -26
  109. scitex/io/_bundle.py +434 -0
  110. scitex/io/_flush.py +5 -2
  111. scitex/io/_load.py +98 -0
  112. scitex/io/_load_modules/_H5Explorer.py +5 -2
  113. scitex/io/_load_modules/_canvas.py +2 -2
  114. scitex/io/_load_modules/_image.py +3 -4
  115. scitex/io/_load_modules/_txt.py +4 -2
  116. scitex/io/_metadata.py +34 -324
  117. scitex/io/_metadata_modules/__init__.py +46 -0
  118. scitex/io/_metadata_modules/_embed.py +70 -0
  119. scitex/io/_metadata_modules/_read.py +64 -0
  120. scitex/io/_metadata_modules/_utils.py +79 -0
  121. scitex/io/_metadata_modules/embed_metadata_jpeg.py +74 -0
  122. scitex/io/_metadata_modules/embed_metadata_pdf.py +53 -0
  123. scitex/io/_metadata_modules/embed_metadata_png.py +26 -0
  124. scitex/io/_metadata_modules/embed_metadata_svg.py +62 -0
  125. scitex/io/_metadata_modules/read_metadata_jpeg.py +57 -0
  126. scitex/io/_metadata_modules/read_metadata_pdf.py +51 -0
  127. scitex/io/_metadata_modules/read_metadata_png.py +39 -0
  128. scitex/io/_metadata_modules/read_metadata_svg.py +44 -0
  129. scitex/io/_qr_utils.py +5 -3
  130. scitex/io/_save.py +548 -30
  131. scitex/io/_save_modules/_canvas.py +3 -3
  132. scitex/io/_save_modules/_image.py +5 -9
  133. scitex/io/_save_modules/_tex.py +7 -4
  134. scitex/io/utils/h5_to_zarr.py +11 -9
  135. scitex/msword/__init__.py +255 -0
  136. scitex/msword/profiles.py +357 -0
  137. scitex/msword/reader.py +753 -0
  138. scitex/msword/utils.py +289 -0
  139. scitex/msword/writer.py +362 -0
  140. scitex/plt/__init__.py +5 -2
  141. scitex/plt/_subplots/_AxesWrapper.py +6 -6
  142. scitex/plt/_subplots/_AxisWrapper.py +15 -9
  143. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +36 -0
  144. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +264 -0
  145. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +213 -0
  146. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +128 -0
  147. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +59 -0
  148. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +34 -0
  149. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +593 -0
  150. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +654 -0
  151. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +527 -0
  152. scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +321 -0
  153. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +33 -0
  154. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +152 -0
  155. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +600 -0
  156. scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +79 -5
  157. scitex/plt/_subplots/_FigWrapper.py +6 -6
  158. scitex/plt/_subplots/_SubplotsWrapper.py +28 -18
  159. scitex/plt/_subplots/_export_as_csv.py +35 -5
  160. scitex/plt/_subplots/_export_as_csv_formatters/__init__.py +8 -0
  161. scitex/plt/_subplots/_export_as_csv_formatters/_format_annotate.py +10 -21
  162. scitex/plt/_subplots/_export_as_csv_formatters/_format_eventplot.py +18 -7
  163. scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py +28 -12
  164. scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py +10 -4
  165. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_imshow.py +13 -1
  166. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_kde.py +12 -2
  167. scitex/plt/_subplots/_export_as_csv_formatters/_format_plot_scatter.py +10 -3
  168. scitex/plt/_subplots/_export_as_csv_formatters/_format_quiver.py +10 -4
  169. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_jointplot.py +18 -3
  170. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_lineplot.py +44 -36
  171. scitex/plt/_subplots/_export_as_csv_formatters/_format_sns_pairplot.py +14 -2
  172. scitex/plt/_subplots/_export_as_csv_formatters/_format_streamplot.py +11 -5
  173. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +84 -0
  174. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +85 -0
  175. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_conf_mat.py +14 -3
  176. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_contour.py +54 -0
  177. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_ecdf.py +14 -2
  178. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +120 -0
  179. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_heatmap.py +16 -6
  180. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_image.py +29 -19
  181. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_imshow.py +63 -0
  182. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_joyplot.py +22 -5
  183. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_ci.py +18 -14
  184. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_mean_std.py +18 -14
  185. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_median_iqr.py +18 -14
  186. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_raster.py +10 -2
  187. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +51 -0
  188. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter_hist.py +18 -9
  189. scitex/plt/ax/_plot/_stx_ecdf.py +4 -2
  190. scitex/plt/gallery/_generate.py +421 -14
  191. scitex/plt/io/__init__.py +53 -0
  192. scitex/plt/io/_bundle.py +490 -0
  193. scitex/plt/io/_layered_bundle.py +1343 -0
  194. scitex/plt/styles/SCITEX_STYLE.yaml +26 -0
  195. scitex/plt/styles/__init__.py +14 -0
  196. scitex/plt/styles/presets.py +78 -0
  197. scitex/plt/utils/__init__.py +13 -1
  198. scitex/plt/utils/_collect_figure_metadata.py +10 -14
  199. scitex/plt/utils/_configure_mpl.py +6 -18
  200. scitex/plt/utils/_crop.py +32 -14
  201. scitex/plt/utils/_csv_column_naming.py +54 -0
  202. scitex/plt/utils/_figure_mm.py +116 -1
  203. scitex/plt/utils/_hitmap.py +1643 -0
  204. scitex/plt/utils/metadata/__init__.py +25 -0
  205. scitex/plt/utils/metadata/_core.py +9 -10
  206. scitex/plt/utils/metadata/_dimensions.py +6 -3
  207. scitex/plt/utils/metadata/_editable_export.py +405 -0
  208. scitex/plt/utils/metadata/_geometry_extraction.py +570 -0
  209. scitex/schema/__init__.py +109 -16
  210. scitex/schema/_canvas.py +1 -1
  211. scitex/schema/_plot.py +1015 -0
  212. scitex/schema/_stats.py +2 -2
  213. scitex/stats/__init__.py +117 -0
  214. scitex/stats/io/__init__.py +29 -0
  215. scitex/stats/io/_bundle.py +156 -0
  216. scitex/tex/__init__.py +4 -0
  217. scitex/tex/_export.py +890 -0
  218. {scitex-2.7.0.dist-info → scitex-2.7.3.dist-info}/METADATA +11 -1
  219. {scitex-2.7.0.dist-info → scitex-2.7.3.dist-info}/RECORD +238 -170
  220. scitex/io/memo.md +0 -2827
  221. scitex/plt/REQUESTS.md +0 -191
  222. scitex/plt/_subplots/TODO.md +0 -53
  223. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin.py +0 -559
  224. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin.py +0 -1609
  225. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin.py +0 -447
  226. scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_between.json +0 -110
  227. scitex/plt/templates/research-master/scitex/vis/gallery/area/fill_betweenx.json +0 -88
  228. scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fill_between.json +0 -103
  229. scitex/plt/templates/research-master/scitex/vis/gallery/area/stx_fillv.json +0 -106
  230. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/bar.json +0 -92
  231. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/barh.json +0 -92
  232. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/boxplot.json +0 -92
  233. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_bar.json +0 -84
  234. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_barh.json +0 -84
  235. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_box.json +0 -83
  236. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_boxplot.json +0 -93
  237. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violin.json +0 -91
  238. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/stx_violinplot.json +0 -91
  239. scitex/plt/templates/research-master/scitex/vis/gallery/categorical/violinplot.json +0 -91
  240. scitex/plt/templates/research-master/scitex/vis/gallery/contour/contour.json +0 -97
  241. scitex/plt/templates/research-master/scitex/vis/gallery/contour/contourf.json +0 -98
  242. scitex/plt/templates/research-master/scitex/vis/gallery/contour/stx_contour.json +0 -84
  243. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist.json +0 -101
  244. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/hist2d.json +0 -96
  245. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_ecdf.json +0 -95
  246. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_joyplot.json +0 -95
  247. scitex/plt/templates/research-master/scitex/vis/gallery/distribution/stx_kde.json +0 -93
  248. scitex/plt/templates/research-master/scitex/vis/gallery/grid/imshow.json +0 -95
  249. scitex/plt/templates/research-master/scitex/vis/gallery/grid/matshow.json +0 -95
  250. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_conf_mat.json +0 -83
  251. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_heatmap.json +0 -92
  252. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_image.json +0 -121
  253. scitex/plt/templates/research-master/scitex/vis/gallery/grid/stx_imshow.json +0 -84
  254. scitex/plt/templates/research-master/scitex/vis/gallery/line/plot.json +0 -110
  255. scitex/plt/templates/research-master/scitex/vis/gallery/line/step.json +0 -92
  256. scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_line.json +0 -95
  257. scitex/plt/templates/research-master/scitex/vis/gallery/line/stx_shaded_line.json +0 -96
  258. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/hexbin.json +0 -95
  259. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/scatter.json +0 -95
  260. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stem.json +0 -92
  261. scitex/plt/templates/research-master/scitex/vis/gallery/scatter/stx_scatter.json +0 -84
  262. scitex/plt/templates/research-master/scitex/vis/gallery/special/pie.json +0 -94
  263. scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_raster.json +0 -109
  264. scitex/plt/templates/research-master/scitex/vis/gallery/special/stx_rectangle.json +0 -108
  265. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/errorbar.json +0 -93
  266. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_errorbar.json +0 -84
  267. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_ci.json +0 -96
  268. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_mean_std.json +0 -96
  269. scitex/plt/templates/research-master/scitex/vis/gallery/statistical/stx_median_iqr.json +0 -96
  270. scitex/plt/templates/research-master/scitex/vis/gallery/vector/quiver.json +0 -99
  271. scitex/plt/templates/research-master/scitex/vis/gallery/vector/streamplot.json +0 -100
  272. scitex/vis/__init__.py +0 -177
  273. scitex/vis/editor/_edit.py +0 -390
  274. scitex/vis/editor/flask_editor/_bbox.py +0 -529
  275. scitex/vis/editor/flask_editor/_core.py +0 -168
  276. scitex/vis/editor/flask_editor/_renderer.py +0 -393
  277. scitex/vis/editor/flask_editor/templates/_html.py +0 -513
  278. scitex/vis/editor/flask_editor/templates/_scripts.py +0 -1261
  279. /scitex/{vis → fig}/README.md +0 -0
  280. /scitex/{vis → fig}/backend/__init__.py +0 -0
  281. /scitex/{vis → fig}/backend/_export.py +0 -0
  282. /scitex/{vis → fig}/backend/_render.py +0 -0
  283. /scitex/{vis → fig}/docs/CANVAS_ARCHITECTURE.md +0 -0
  284. /scitex/{vis → fig}/editor/__init__.py +0 -0
  285. /scitex/{vis → fig}/editor/_dearpygui_editor.py +0 -0
  286. /scitex/{vis → fig}/editor/_flask_editor.py +0 -0
  287. /scitex/{vis → fig}/editor/_mpl_editor.py +0 -0
  288. /scitex/{vis → fig}/editor/_tkinter_editor.py +0 -0
  289. /scitex/{vis → fig}/editor/flask_editor/__init__.py +0 -0
  290. /scitex/{vis → fig}/editor/flask_editor/_utils.py +0 -0
  291. /scitex/{vis → fig}/io/_directory.py +0 -0
  292. /scitex/{vis → fig}/model/_plot_types.py +0 -0
  293. /scitex/{vis → fig}/utils/_defaults.py +0 -0
  294. /scitex/{vis → fig}/utils/_validate.py +0 -0
  295. {scitex-2.7.0.dist-info → scitex-2.7.3.dist-info}/WHEEL +0 -0
  296. {scitex-2.7.0.dist-info → scitex-2.7.3.dist-info}/entry_points.txt +0 -0
  297. {scitex-2.7.0.dist-info → scitex-2.7.3.dist-info}/licenses/LICENSE +0 -0
@@ -14,6 +14,10 @@ import warnings
14
14
  import numpy as np
15
15
  import pandas as pd
16
16
 
17
+ from scitex import logging
18
+
19
+ logger = logging.getLogger(__name__)
20
+
17
21
 
18
22
  class FigWrapper:
19
23
  def __init__(self, fig_mpl):
@@ -169,9 +173,7 @@ class FigWrapper:
169
173
  auto_metadata["custom"].update(metadata)
170
174
  except Exception as e:
171
175
  # If metadata collection fails, warn but continue
172
- import warnings
173
-
174
- warnings.warn(f"Could not collect metadata: {e}")
176
+ logger.warning(f"Could not collect metadata: {e}")
175
177
  auto_metadata = metadata
176
178
 
177
179
  # Use scitex.io.save_image for metadata embedding
@@ -183,9 +185,7 @@ class FigWrapper:
183
185
  )
184
186
  except Exception as e:
185
187
  # Fallback to regular matplotlib savefig
186
- import warnings
187
-
188
- warnings.warn(f"Metadata embedding failed, using regular savefig: {e}")
188
+ logger.warning(f"Metadata embedding failed, using regular savefig: {e}")
189
189
  self._fig_mpl.savefig(fname, *args, **kwargs)
190
190
  else:
191
191
  # For non-image formats or when metadata disabled, use regular savefig
@@ -62,24 +62,13 @@ if _arial_enabled:
62
62
  ]
63
63
  else:
64
64
  # Warn about missing Arial
65
- try:
66
- from scitex.logging import getLogger
65
+ from scitex import logging as _logging
67
66
 
68
- _logger = getLogger(__name__)
69
- _logger.warning(
70
- "Arial font not found. Using fallback fonts (Helvetica/DejaVu Sans). "
71
- "For publication figures with Arial: sudo apt-get install ttf-mscorefonts-installer && fc-cache -fv"
72
- )
73
- except:
74
- # If scitex.logging not available, use standard warnings
75
- import warnings
76
-
77
- warnings.warn(
78
- "Arial font not found. Using fallback fonts (Helvetica/DejaVu Sans). "
79
- "For publication figures with Arial: sudo apt-get install ttf-mscorefonts-installer && fc-cache -fv",
80
- UserWarning,
81
- stacklevel=2,
82
- )
67
+ _logger = _logging.getLogger(__name__)
68
+ _logger.warning(
69
+ "Arial font not found. Using fallback fonts (Helvetica/DejaVu Sans). "
70
+ "For publication figures with Arial: sudo apt-get install ttf-mscorefonts-installer && fc-cache -fv"
71
+ )
83
72
 
84
73
 
85
74
  class SubplotsWrapper:
@@ -124,6 +113,7 @@ class SubplotsWrapper:
124
113
  dpi=None,
125
114
  styles=None, # List of style dicts for per-axes control
126
115
  transparent=None, # Transparent background (default: from SCITEX_STYLE.yaml)
116
+ theme=None, # Color theme: "light" or "dark" (default: "light")
127
117
  **kwargs,
128
118
  ):
129
119
  """
@@ -179,6 +169,9 @@ class SubplotsWrapper:
179
169
  transparent : bool, optional
180
170
  Create figure with transparent background (default: False)
181
171
  Useful for publication-ready figures that will be cropped
172
+ theme : str, optional
173
+ Color theme: "light" or "dark" (default: "light")
174
+ Dark mode uses eye-friendly colors optimized for dark backgrounds
182
175
  **kwargs
183
176
  Additional arguments passed to matplotlib.pyplot.subplots
184
177
 
@@ -287,6 +280,9 @@ class SubplotsWrapper:
287
280
  transparent = _S.get("transparent", True)
288
281
  if mode is None:
289
282
  mode = _S.get("mode", "publication")
283
+ # Resolve theme from YAML (default: "light")
284
+ if theme is None:
285
+ theme = _resolve("theme.mode", None, "light", str)
290
286
 
291
287
  # Always use mm-control pathway with SCITEX_STYLE defaults
292
288
  if True:
@@ -319,6 +315,7 @@ class SubplotsWrapper:
319
315
  dpi=dpi,
320
316
  styles=styles,
321
317
  transparent=transparent,
318
+ theme=theme,
322
319
  **kwargs,
323
320
  )
324
321
 
@@ -355,17 +352,22 @@ class SubplotsWrapper:
355
352
  dpi=None,
356
353
  styles=None,
357
354
  transparent=None, # Resolved from caller
355
+ theme=None, # Color theme: "light" or "dark"
358
356
  **kwargs,
359
357
  ):
360
358
  """Create figure with mm-based control over axes dimensions."""
361
359
  from scitex.plt.utils import mm_to_inch, apply_style_mm
362
360
 
363
- # Parse nrows, ncols from args (like matplotlib.pyplot.subplots)
361
+ # Parse nrows, ncols from args or kwargs (like matplotlib.pyplot.subplots)
364
362
  nrows, ncols = 1, 1
365
363
  if len(args) >= 1:
366
364
  nrows = args[0]
365
+ elif "nrows" in kwargs:
366
+ nrows = kwargs.pop("nrows")
367
367
  if len(args) >= 2:
368
368
  ncols = args[1]
369
+ elif "ncols" in kwargs:
370
+ ncols = kwargs.pop("ncols")
369
371
 
370
372
  n_axes = nrows * ncols
371
373
 
@@ -451,6 +453,10 @@ class SubplotsWrapper:
451
453
  else:
452
454
  self._fig_mpl = plt.figure(figsize=figsize_inch, dpi=dpi)
453
455
 
456
+ # Store theme on figure for later retrieval (e.g., when saving plot.json)
457
+ if theme is not None:
458
+ self._fig_mpl._scitex_theme = theme
459
+
454
460
  # Create axes array and position each one manually
455
461
  axes_mpl_list = []
456
462
  ax_idx = 0
@@ -541,6 +547,10 @@ class SubplotsWrapper:
541
547
  if n_ticks is not None:
542
548
  style_dict["n_ticks"] = n_ticks
543
549
 
550
+ # Always add theme to style_dict (default: "light")
551
+ if theme is not None:
552
+ style_dict["theme"] = theme
553
+
544
554
  # Extract suptitle font size if available
545
555
  if "suptitle_font_size_pt" in style_dict:
546
556
  suptitle_font_size_pt_value = style_dict["suptitle_font_size_pt"]
@@ -10,12 +10,14 @@ __FILE__ = __file__
10
10
  __DIR__ = os.path.dirname(__FILE__)
11
11
  # ----------------------------------------
12
12
 
13
- import warnings
14
-
15
13
  import numpy as np
16
14
  import pandas as pd
17
15
  from scitex.pd import to_xyz
18
16
 
17
+ from scitex import logging
18
+
19
+ logger = logging.getLogger(__name__)
20
+
19
21
  # Global warning registry to track which warnings have been shown
20
22
  _warning_registry = set()
21
23
 
@@ -59,7 +61,7 @@ def _warn_once(message, category=UserWarning):
59
61
  """
60
62
  if message not in _warning_registry:
61
63
  _warning_registry.add(message)
62
- warnings.warn(message, category, stacklevel=3)
64
+ logger.warning(message)
63
65
 
64
66
 
65
67
  from ._export_as_csv_formatters import (
@@ -93,11 +95,13 @@ from ._export_as_csv_formatters import (
93
95
  # Custom scitex formatters
94
96
  _format_plot_box,
95
97
  _format_plot_conf_mat,
98
+ _format_stx_contour,
96
99
  _format_plot_ecdf,
97
100
  _format_plot_fillv,
98
101
  _format_plot_heatmap,
99
102
  _format_plot_image,
100
103
  _format_plot_imshow,
104
+ _format_stx_imshow,
101
105
  _format_plot_joyplot,
102
106
  _format_plot_kde,
103
107
  _format_plot_line,
@@ -110,6 +114,11 @@ from ._export_as_csv_formatters import (
110
114
  _format_plot_scatter_hist,
111
115
  _format_plot_shaded_line,
112
116
  _format_plot_violin,
117
+ # stx_ aliases formatters
118
+ _format_stx_scatter,
119
+ _format_stx_bar,
120
+ _format_stx_barh,
121
+ _format_stx_errorbar,
113
122
  # Seaborn formatters
114
123
  _format_sns_barplot,
115
124
  _format_sns_boxplot,
@@ -157,11 +166,13 @@ _FORMATTER_REGISTRY = {
157
166
  # Custom scitex methods
158
167
  "stx_box": _format_plot_box,
159
168
  "stx_conf_mat": _format_plot_conf_mat,
169
+ "stx_contour": _format_stx_contour,
160
170
  "stx_ecdf": _format_plot_ecdf,
161
171
  "stx_fillv": _format_plot_fillv,
162
172
  "stx_heatmap": _format_plot_heatmap,
163
173
  "stx_image": _format_plot_image,
164
174
  "plot_imshow": _format_plot_imshow,
175
+ "stx_imshow": _format_stx_imshow,
165
176
  "stx_joyplot": _format_plot_joyplot,
166
177
  "stx_kde": _format_plot_kde,
167
178
  "stx_line": _format_plot_line,
@@ -174,6 +185,11 @@ _FORMATTER_REGISTRY = {
174
185
  "stx_scatter_hist": _format_plot_scatter_hist,
175
186
  "stx_shaded_line": _format_plot_shaded_line,
176
187
  "stx_violin": _format_plot_violin,
188
+ # stx_ aliases
189
+ "stx_scatter": _format_stx_scatter,
190
+ "stx_bar": _format_stx_bar,
191
+ "stx_barh": _format_stx_barh,
192
+ "stx_errorbar": _format_stx_errorbar,
177
193
  # Seaborn methods (sns_ prefix)
178
194
  "sns_barplot": _format_sns_barplot,
179
195
  "sns_boxplot": _format_sns_boxplot,
@@ -226,7 +242,7 @@ def export_as_csv(history_records):
226
242
  ValueError: If no plotting records are found or they cannot be combined.
227
243
  """
228
244
  if len(history_records) <= 0:
229
- warnings.warn("Plotting records not found. Cannot export empty data.")
245
+ logger.warning("Plotting records not found. Cannot export empty data.")
230
246
  return pd.DataFrame() # Return empty DataFrame instead of None
231
247
 
232
248
  dfs = []
@@ -268,7 +284,7 @@ def export_as_csv(history_records):
268
284
  df = pd.concat(dfs_reset, axis=1)
269
285
  return df
270
286
  except Exception as e:
271
- warnings.warn(f"Failed to combine plotting records: {e}")
287
+ logger.warning(f"Failed to combine plotting records: {e}")
272
288
  # Return a DataFrame with metadata about what records were attempted
273
289
  meta_df = pd.DataFrame(
274
290
  {
@@ -355,6 +371,8 @@ def format_record(record, record_index=0):
355
371
  return _format_plot_box(id, tracked_dict, kwargs)
356
372
  elif method == "stx_conf_mat":
357
373
  return _format_plot_conf_mat(id, tracked_dict, kwargs)
374
+ elif method == "stx_contour":
375
+ return _format_stx_contour(id, tracked_dict, kwargs)
358
376
  elif method == "stx_ecdf":
359
377
  return _format_plot_ecdf(id, tracked_dict, kwargs)
360
378
  elif method == "stx_fillv":
@@ -365,6 +383,8 @@ def format_record(record, record_index=0):
365
383
  return _format_plot_image(id, tracked_dict, kwargs)
366
384
  elif method == "plot_imshow":
367
385
  return _format_plot_imshow(id, tracked_dict, kwargs)
386
+ elif method == "stx_imshow":
387
+ return _format_stx_imshow(id, tracked_dict, kwargs)
368
388
  elif method == "stx_joyplot":
369
389
  return _format_plot_joyplot(id, tracked_dict, kwargs)
370
390
  elif method == "stx_kde":
@@ -390,6 +410,16 @@ def format_record(record, record_index=0):
390
410
  elif method == "stx_violin":
391
411
  return _format_plot_violin(id, tracked_dict, kwargs)
392
412
 
413
+ # stx_ aliases
414
+ elif method == "stx_scatter":
415
+ return _format_stx_scatter(id, tracked_dict, kwargs)
416
+ elif method == "stx_bar":
417
+ return _format_stx_bar(id, tracked_dict, kwargs)
418
+ elif method == "stx_barh":
419
+ return _format_stx_barh(id, tracked_dict, kwargs)
420
+ elif method == "stx_errorbar":
421
+ return _format_stx_errorbar(id, tracked_dict, kwargs)
422
+
393
423
  # Seaborn functions (sns_ prefix)
394
424
  elif method == "sns_barplot":
395
425
  return _format_sns_barplot(id, tracked_dict, kwargs)
@@ -41,10 +41,12 @@ from ._format_violinplot import _format_violinplot
41
41
  from ._format_plot_imshow import _format_plot_imshow
42
42
  from ._format_plot_box import _format_plot_box
43
43
  from ._format_stx_conf_mat import _format_plot_conf_mat
44
+ from ._format_stx_contour import _format_stx_contour
44
45
  from ._format_stx_ecdf import _format_plot_ecdf
45
46
  from ._format_stx_fillv import _format_plot_fillv
46
47
  from ._format_stx_heatmap import _format_plot_heatmap
47
48
  from ._format_stx_image import _format_plot_image
49
+ from ._format_stx_imshow import _format_stx_imshow
48
50
  from ._format_stx_joyplot import _format_plot_joyplot
49
51
  from ._format_plot_kde import _format_plot_kde
50
52
  from ._format_stx_line import _format_plot_line
@@ -58,6 +60,12 @@ from ._format_stx_scatter_hist import _format_plot_scatter_hist
58
60
  from ._format_stx_shaded_line import _format_plot_shaded_line
59
61
  from ._format_stx_violin import _format_plot_violin
60
62
 
63
+ # stx_ aliases formatters
64
+ from ._format_stx_scatter import _format_stx_scatter
65
+ from ._format_stx_bar import _format_stx_bar
66
+ from ._format_stx_barh import _format_stx_barh
67
+ from ._format_stx_errorbar import _format_stx_errorbar
68
+
61
69
  # Seaborn formatters (sns_ prefix)
62
70
  from ._format_sns_barplot import _format_sns_barplot
63
71
  from ._format_sns_boxplot import _format_sns_boxplot
@@ -12,22 +12,8 @@ __DIR__ = os.path.dirname(__FILE__)
12
12
 
13
13
  import pandas as pd
14
14
 
15
-
16
- def _make_column_name(id, suffix, method="annotate"):
17
- """Create column name with method descriptor, avoiding duplication.
18
-
19
- For example:
20
- - id="annotate_0", suffix="x" -> "annotate_0_x"
21
- - id="plot_5", suffix="x" -> "plot_5_annotate_x"
22
- """
23
- # Check if method name is already in the ID
24
- id_parts = id.rsplit("_", 1)
25
- if len(id_parts) == 2 and id_parts[0].endswith(method):
26
- # Method already in ID, don't duplicate
27
- return f"{id}_{suffix}"
28
- else:
29
- # Method not in ID, add it for clarity
30
- return f"{id}_{method}_{suffix}"
15
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
16
+ from ._format_plot import _parse_tracking_id
31
17
 
32
18
 
33
19
  def _format_annotate(id, tracked_dict, kwargs):
@@ -42,6 +28,9 @@ def _format_annotate(id, tracked_dict, kwargs):
42
28
  if not tracked_dict or not isinstance(tracked_dict, dict):
43
29
  return pd.DataFrame()
44
30
 
31
+ # Parse the tracking ID to get axes position and trace ID
32
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
33
+
45
34
  # Get the args from tracked_dict
46
35
  args = tracked_dict.get("args", [])
47
36
 
@@ -57,9 +46,9 @@ def _format_annotate(id, tracked_dict, kwargs):
57
46
  return pd.DataFrame()
58
47
 
59
48
  data = {
60
- _make_column_name(id, "x"): [x],
61
- _make_column_name(id, "y"): [y],
62
- _make_column_name(id, "content"): [text_content],
49
+ get_csv_column_name("x", ax_row, ax_col, trace_id=trace_id): [x],
50
+ get_csv_column_name("y", ax_row, ax_col, trace_id=trace_id): [y],
51
+ get_csv_column_name("content", ax_row, ax_col, trace_id=trace_id): [text_content],
63
52
  }
64
53
 
65
54
  # Check if xytext was provided (either as third arg or in kwargs)
@@ -70,8 +59,8 @@ def _format_annotate(id, tracked_dict, kwargs):
70
59
  xytext = kwargs["xytext"]
71
60
 
72
61
  if xytext is not None and hasattr(xytext, "__len__") and len(xytext) >= 2:
73
- data[_make_column_name(id, "text_x")] = [xytext[0]]
74
- data[_make_column_name(id, "text_y")] = [xytext[1]]
62
+ data[get_csv_column_name("text_x", ax_row, ax_col, trace_id=trace_id)] = [xytext[0]]
63
+ data[get_csv_column_name("text_y", ax_row, ax_col, trace_id=trace_id)] = [xytext[1]]
75
64
 
76
65
  # Create DataFrame with proper column names (use dict with list values)
77
66
  df = pd.DataFrame(data)
@@ -13,6 +13,12 @@ import numpy as np
13
13
  import pandas as pd
14
14
  import scitex
15
15
 
16
+ from scitex import logging
17
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
18
+ from ._format_plot import _parse_tracking_id
19
+
20
+ logger = logging.getLogger(__name__)
21
+
16
22
 
17
23
  def _format_eventplot(id, tracked_dict, kwargs):
18
24
  """Format data from an eventplot call."""
@@ -20,6 +26,9 @@ def _format_eventplot(id, tracked_dict, kwargs):
20
26
  if not tracked_dict or not isinstance(tracked_dict, dict):
21
27
  return pd.DataFrame()
22
28
 
29
+ # Parse the tracking ID to get axes position and trace ID
30
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
31
+
23
32
  # Get the args from tracked_dict
24
33
  args = tracked_dict.get("args", [])
25
34
 
@@ -36,13 +45,15 @@ def _format_eventplot(id, tracked_dict, kwargs):
36
45
  if isinstance(positions, (list, np.ndarray)) and not isinstance(
37
46
  positions[0], (list, np.ndarray)
38
47
  ):
39
- return pd.DataFrame({f"{id}_eventplot_events": positions})
48
+ col_name = get_csv_column_name("eventplot-events", ax_row, ax_col, trace_id=trace_id)
49
+ return pd.DataFrame({col_name: positions})
40
50
 
41
51
  # If positions is a list of arrays (multiple event sets)
42
52
  elif isinstance(positions, (list, np.ndarray)):
43
53
  data = {}
44
54
  for i, events in enumerate(positions):
45
- data[f"{id}_eventplot_events{i:02d}"] = events
55
+ col_name = get_csv_column_name(f"eventplot-events{i:02d}", ax_row, ax_col, trace_id=f"{trace_id}-{i}")
56
+ data[col_name] = events
46
57
 
47
58
  # Use force_df to handle different length arrays
48
59
  return scitex.pd.force_df(data)
@@ -53,20 +64,20 @@ def _format_eventplot(id, tracked_dict, kwargs):
53
64
  if isinstance(positions, (list, np.ndarray)) and not isinstance(
54
65
  positions[0], (list, np.ndarray)
55
66
  ):
56
- return pd.DataFrame({f"{id}_eventplot_events": positions})
67
+ col_name = get_csv_column_name("eventplot-events", ax_row, ax_col, trace_id=trace_id)
68
+ return pd.DataFrame({col_name: positions})
57
69
 
58
70
  # If positions is a list of arrays (multiple event sets)
59
71
  elif isinstance(positions, (list, np.ndarray)):
60
72
  # Create a DataFrame where each column is a Series that can handle varying lengths
61
73
  df = pd.DataFrame()
62
74
  for i, events in enumerate(positions):
63
- df[f"{id}_eventplot_events{i:02d}"] = pd.Series(events)
75
+ col_name = get_csv_column_name(f"eventplot-events{i:02d}", ax_row, ax_col, trace_id=f"{trace_id}-{i}")
76
+ df[col_name] = pd.Series(events)
64
77
  return df
65
78
  except Exception as e:
66
79
  # If all else fails, return an empty DataFrame
67
- import warnings
68
-
69
- warnings.warn(f"Error formatting eventplot data: {str(e)}")
80
+ logger.warning(f"Error formatting eventplot data: {str(e)}")
70
81
  return pd.DataFrame()
71
82
 
72
83
  return pd.DataFrame()
@@ -1,32 +1,48 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- # Timestamp: "2025-05-18 18:14:26 (ywatanabe)"
4
- # File: /data/gpfs/projects/punim2354/ywatanabe/scitex_repo/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py
5
- # ----------------------------------------
6
- import os
7
-
8
- __FILE__ = __file__
9
- __DIR__ = os.path.dirname(__FILE__)
10
- # ----------------------------------------
3
+ # Timestamp: "2025-12-13 (ywatanabe)"
4
+ # File: /home/ywatanabe/proj/scitex-code/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_imshow2d.py
11
5
 
12
6
  import pandas as pd
13
7
 
8
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
9
+ from ._format_plot import _parse_tracking_id
10
+
14
11
 
15
12
  def _format_imshow2d(id, tracked_dict, kwargs):
16
- """Format data from an imshow2d call."""
13
+ """Format data from an imshow2d call.
14
+
15
+ Args:
16
+ id (str): Identifier for the plot
17
+ tracked_dict (dict): Dictionary containing tracked data
18
+ kwargs (dict): Keyword arguments passed to imshow2d
19
+
20
+ Returns:
21
+ pd.DataFrame: Formatted data from imshow2d
22
+ """
17
23
  # Check if tracked_dict is empty or not a dictionary
18
24
  if not tracked_dict or not isinstance(tracked_dict, dict):
19
25
  return pd.DataFrame()
20
26
 
27
+ # Parse the tracking ID to get axes position and trace ID
28
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
29
+
21
30
  # Get the args from tracked_dict
22
31
  args = tracked_dict.get("args", [])
23
32
 
24
33
  # Extract data if available
25
34
  if len(args) >= 1 and isinstance(args[0], pd.DataFrame):
26
35
  df = args[0].copy()
27
- # Add prefixes to columns and index if needed
28
- # df.columns = [f"{id}_imshow2d_{col}" for col in df.columns]
29
- # df.index = [f"{id}_imshow2d_{idx}" for idx in df.index]
36
+ # Rename columns using the single source of truth
37
+ renamed_cols = {}
38
+ for col in df.columns:
39
+ renamed_cols[col] = get_csv_column_name(
40
+ f"imshow2d_{col}", ax_row, ax_col, trace_id=trace_id
41
+ )
42
+ df = df.rename(columns=renamed_cols)
30
43
  return df
31
44
 
32
45
  return pd.DataFrame()
46
+
47
+
48
+ # EOF
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- # Timestamp: "2025-12-01 12:20:00 (ywatanabe)"
3
+ # Timestamp: "2025-12-13 (ywatanabe)"
4
4
  # File: /home/ywatanabe/proj/scitex-code/src/scitex/plt/_subplots/_export_as_csv_formatters/_format_matshow.py
5
5
 
6
6
  import numpy as np
7
7
  import pandas as pd
8
8
 
9
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
10
+ from ._format_plot import _parse_tracking_id
11
+
9
12
 
10
13
  def _format_matshow(id, tracked_dict, kwargs):
11
14
  """Format data from a matshow call.
@@ -21,6 +24,9 @@ def _format_matshow(id, tracked_dict, kwargs):
21
24
  if not tracked_dict or not isinstance(tracked_dict, dict):
22
25
  return pd.DataFrame()
23
26
 
27
+ # Parse the tracking ID to get axes position and trace ID
28
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
29
+
24
30
  if "args" in tracked_dict:
25
31
  args = tracked_dict["args"]
26
32
  if isinstance(args, tuple) and len(args) > 0:
@@ -31,9 +37,9 @@ def _format_matshow(id, tracked_dict, kwargs):
31
37
 
32
38
  df = pd.DataFrame(
33
39
  {
34
- f"{id}_matshow_row": rows.flatten(),
35
- f"{id}_matshow_col": cols.flatten(),
36
- f"{id}_matshow_value": Z.flatten(),
40
+ get_csv_column_name("row", ax_row, ax_col, trace_id=trace_id): rows.flatten(),
41
+ get_csv_column_name("col", ax_row, ax_col, trace_id=trace_id): cols.flatten(),
42
+ get_csv_column_name("value", ax_row, ax_col, trace_id=trace_id): Z.flatten(),
37
43
  }
38
44
  )
39
45
  return df
@@ -10,6 +10,8 @@ __DIR__ = os.path.dirname(__FILE__)
10
10
  # ----------------------------------------
11
11
 
12
12
  import pandas as pd
13
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
14
+ from ._format_plot import _parse_tracking_id
13
15
 
14
16
 
15
17
  def _format_plot_imshow(id, tracked_dict, kwargs):
@@ -29,8 +31,18 @@ def _format_plot_imshow(id, tracked_dict, kwargs):
29
31
 
30
32
  # Add id prefix to column names if id is provided
31
33
  if id is not None:
34
+ # Parse tracking ID to extract axes position and trace ID
35
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
36
+
37
+ # Use standardized column naming for each column
32
38
  df = df.copy()
33
- df.columns = [f"{id}_plot_imshow_{col}" for col in df.columns]
39
+ renamed_cols = {}
40
+ for col in df.columns:
41
+ # Create column name like "plot_imshow_row" or "plot_imshow_col"
42
+ renamed_cols[col] = get_csv_column_name(
43
+ f"plot_imshow_{col}", ax_row, ax_col, trace_id=trace_id
44
+ )
45
+ df.rename(columns=renamed_cols, inplace=True)
34
46
 
35
47
  return df
36
48
 
@@ -11,6 +11,8 @@ __DIR__ = os.path.dirname(__FILE__)
11
11
 
12
12
  import pandas as pd
13
13
  from scitex.pd import force_df
14
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
15
+ from ._format_plot import _parse_tracking_id
14
16
 
15
17
 
16
18
  def _format_plot_kde(id, tracked_dict, kwargs):
@@ -37,13 +39,21 @@ def _format_plot_kde(id, tracked_dict, kwargs):
37
39
  if x is None or kde is None:
38
40
  return pd.DataFrame()
39
41
 
40
- df = pd.DataFrame({f"{id}_kde_x": x, f"{id}_kde_density": kde})
42
+ # Parse tracking ID to extract axes position and trace ID
43
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
44
+
45
+ # Use standardized column naming
46
+ x_col = get_csv_column_name("kde_x", ax_row, ax_col, trace_id=trace_id)
47
+ density_col = get_csv_column_name("kde_density", ax_row, ax_col, trace_id=trace_id)
48
+
49
+ df = pd.DataFrame({x_col: x, density_col: kde})
41
50
 
42
51
  # Add sample count if available
43
52
  if n is not None:
44
53
  # If n is a scalar, create a list with the same length as x
45
54
  if not hasattr(n, "__len__"):
46
55
  n = [n] * len(x)
47
- df[f"{id}_kde_n"] = n
56
+ n_col = get_csv_column_name("kde_n", ax_row, ax_col, trace_id=trace_id)
57
+ df[n_col] = n
48
58
 
49
59
  return df
@@ -10,6 +10,8 @@ __DIR__ = os.path.dirname(__FILE__)
10
10
  # ----------------------------------------
11
11
 
12
12
  import pandas as pd
13
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
14
+ from ._format_plot import _parse_tracking_id
13
15
 
14
16
 
15
17
  def _format_plot_scatter(id, tracked_dict, kwargs):
@@ -26,10 +28,15 @@ def _format_plot_scatter(id, tracked_dict, kwargs):
26
28
  scatter_df = tracked_dict.get("scatter_df")
27
29
 
28
30
  if scatter_df is not None and isinstance(scatter_df, pd.DataFrame):
31
+ # Parse tracking ID to extract axes position and trace ID
32
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
33
+
34
+ # Use standardized column naming
35
+ x_col = get_csv_column_name("scatter_x", ax_row, ax_col, trace_id=trace_id)
36
+ y_col = get_csv_column_name("scatter_y", ax_row, ax_col, trace_id=trace_id)
37
+
29
38
  # Rename columns to include the id
30
- return scatter_df.rename(
31
- columns={"x": f"{id}_scatter_x", "y": f"{id}_scatter_y"}
32
- )
39
+ return scatter_df.rename(columns={"x": x_col, "y": y_col})
33
40
 
34
41
  return pd.DataFrame()
35
42
 
@@ -6,6 +6,9 @@
6
6
  import numpy as np
7
7
  import pandas as pd
8
8
 
9
+ from scitex.plt.utils._csv_column_naming import get_csv_column_name
10
+ from ._format_plot import _parse_tracking_id
11
+
9
12
 
10
13
  def _format_quiver(id, tracked_dict, kwargs):
11
14
  """Format data from a quiver (vector field) call.
@@ -21,6 +24,9 @@ def _format_quiver(id, tracked_dict, kwargs):
21
24
  if not tracked_dict or not isinstance(tracked_dict, dict):
22
25
  return pd.DataFrame()
23
26
 
27
+ # Parse the tracking ID to get axes position and trace ID
28
+ ax_row, ax_col, trace_id = _parse_tracking_id(id)
29
+
24
30
  if "args" in tracked_dict:
25
31
  args = tracked_dict["args"]
26
32
  if isinstance(args, tuple):
@@ -41,10 +47,10 @@ def _format_quiver(id, tracked_dict, kwargs):
41
47
 
42
48
  df = pd.DataFrame(
43
49
  {
44
- f"{id}_quiver_x": X.flatten(),
45
- f"{id}_quiver_y": Y.flatten(),
46
- f"{id}_quiver_u": U.flatten(),
47
- f"{id}_quiver_v": V.flatten(),
50
+ get_csv_column_name("quiver-x", ax_row, ax_col, trace_id=trace_id): X.flatten(),
51
+ get_csv_column_name("quiver-y", ax_row, ax_col, trace_id=trace_id): Y.flatten(),
52
+ get_csv_column_name("quiver-u", ax_row, ax_col, trace_id=trace_id): U.flatten(),
53
+ get_csv_column_name("quiver-v", ax_row, ax_col, trace_id=trace_id): V.flatten(),
48
54
  }
49
55
  )
50
56
  return df