canvod.viz API Reference¶
2D and 3D hemispheric visualization tools.
Package¶
Visualization and plotting utilities for GNSS VOD data.
This package provides 2D and 3D visualization capabilities for hemispherical GNSS grids and VOD data, with both publication-quality (matplotlib) and interactive (plotly) rendering options.
Examples¶
2D polar visualization::
from canvod.viz import HemisphereVisualizer2D
from canvod.grids import create_hemigrid
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0)
viz = HemisphereVisualizer2D(grid)
fig, ax = viz.plot_grid_patches(data=vod_data, title="VOD Distribution")
Convenience function::
from canvod.viz import visualize_grid, add_tissot_indicatrix
fig, ax = visualize_grid(grid, data=vod_data, cmap='viridis')
add_tissot_indicatrix(ax, grid, n_sample=5)
3D interactive visualization::
from canvod.viz import HemisphereVisualizer3D
viz3d = HemisphereVisualizer3D(grid)
fig = viz3d.plot_hemisphere_surface(data=vod_data, title="Interactive VOD")
fig.show()
Unified API::
from canvod.viz import HemisphereVisualizer
viz = HemisphereVisualizer(grid)
fig_2d, ax_2d = viz.plot_2d(data=vod_data)
fig_3d = viz.plot_3d(data=vod_data)
HemisphereVisualizer
¶
Unified hemisphere visualizer combining 2D and 3D capabilities.
Provides consistent API for both publication-quality matplotlib plots and interactive plotly visualizations. Handles styling coordination between different rendering backends.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
Create both 2D and 3D visualizations::
from canvod.grids import create_hemigrid
from canvod.viz import HemisphereVisualizer
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0)
viz = HemisphereVisualizer(grid)
# Publication-quality 2D plot
fig_2d, ax_2d = viz.plot_2d(
data=vod_data,
title="VOD Distribution",
save_path="publication.png"
)
# Interactive 3D plot
fig_3d = viz.plot_3d(
data=vod_data,
title="Interactive VOD Explorer"
)
fig_3d.show()
Switch styles easily::
# Publication style
pub_style = create_publication_style()
viz.set_style(pub_style)
fig, ax = viz.plot_2d(data=vod_data)
# Interactive style
int_style = create_interactive_style(dark_mode=True)
viz.set_style(int_style)
fig = viz.plot_3d(data=vod_data)
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
__init__(grid)
¶
Initialize unified visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
set_style(style)
¶
Set unified styling for both 2D and 3D plots.
Parameters¶
style : PlotStyle Styling configuration
Examples¶
pub_style = create_publication_style() viz.set_style(pub_style) fig, ax = viz.plot_2d(data=vod_data)
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
plot_2d(data=None, title=None, ax=None, save_path=None, style=None, **kwargs)
¶
Create 2D publication-quality plot.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title ax : matplotlib.axes.Axes, optional Existing axes to plot on save_path : Path or str, optional Save figure to this path style : PolarPlotStyle, optional Override default 2D style **kwargs Additional styling parameters
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes with plot
Examples¶
fig, ax = viz.plot_2d( ... data=vod_data, ... title="VOD Distribution", ... cmap='plasma', ... save_path="output.png", ... dpi=300 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
plot_3d(data=None, title=None, style=None, **kwargs)
¶
Create 3D interactive plot.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title style : PlotStyle, optional Override default 3D style **kwargs Additional plotly parameters
Returns¶
plotly.graph_objects.Figure Interactive 3D figure
Examples¶
fig = viz.plot_3d( ... data=vod_data, ... title="Interactive VOD", ... opacity=0.9, ... width=1000, ... height=800 ... ) fig.show() fig.write_html("interactive.html")
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
plot_3d_mesh(data=None, title=None, **kwargs)
¶
Create 3D mesh plot showing cell boundaries.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title **kwargs Additional plotly parameters
Returns¶
plotly.graph_objects.Figure Interactive mesh figure
Examples¶
fig = viz.plot_3d_mesh( ... data=vod_data, ... title="VOD Mesh View", ... opacity=0.7 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
create_comparison_plot(data=None, title_2d='2D Polar View', title_3d='3D Hemisphere View', save_2d=None, save_3d=None)
¶
Create both 2D and 3D plots for comparison.
Parameters¶
data : np.ndarray, optional Data values per cell title_2d : str, default "2D Polar View" Title for 2D plot title_3d : str, default "3D Hemisphere View" Title for 3D plot save_2d : Path or str, optional Save 2D figure to this path save_3d : Path or str, optional Save 3D figure to this path (HTML)
Returns¶
plot_2d : tuple of Figure and Axes 2D matplotlib plot plot_3d : plotly.graph_objects.Figure 3D plotly plot
Examples¶
(fig_2d, ax_2d), fig_3d = viz.create_comparison_plot( ... data=vod_data, ... save_2d="comparison_2d.png", ... save_3d="comparison_3d.html" ... ) plt.show() # Show 2D fig_3d.show() # Show 3D
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
create_publication_figure(data=None, title='Hemispherical Data Distribution', save_path=None, dpi=300, **kwargs)
¶
Create publication-ready figure with optimal styling.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, default "Hemispherical Data Distribution" Plot title save_path : Path or str, optional Save figure to this path dpi : int, default 300 Resolution in dots per inch **kwargs Additional styling parameters
Returns¶
fig : matplotlib.figure.Figure Publication-ready figure ax : matplotlib.axes.Axes Styled polar axes
Examples¶
fig, ax = viz.create_publication_figure( ... data=vod_data, ... title="VOD Distribution Over Rosalia Site", ... save_path="paper_figure_3.png", ... dpi=600 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
create_interactive_explorer(data=None, title='Interactive Data Explorer', dark_mode=True, save_html=None)
¶
Create interactive explorer with optimal settings.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, default "Interactive Data Explorer" Plot title dark_mode : bool, default True Use dark theme save_html : Path or str, optional Save HTML to this path
Returns¶
plotly.graph_objects.Figure Interactive explorer figure
Examples¶
fig = viz.create_interactive_explorer( ... data=vod_data, ... title="VOD Explorer", ... dark_mode=True, ... save_html="explorer.html" ... ) fig.show()
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
HemisphereVisualizer2D
¶
2D hemisphere visualization using matplotlib.
Creates publication-quality polar projection plots of hemispherical grids. Supports multiple grid types and rendering methods.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import HemisphereVisualizer2D
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) viz = HemisphereVisualizer2D(grid) fig, ax = viz.plot_grid_patches(data=vod_data, title="VOD Distribution") plt.savefig("vod_plot.png", dpi=300, bbox_inches='tight')
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
__init__(grid)
¶
Initialize 2D hemisphere visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
50 51 52 53 54 55 56 57 58 59 60 61 | |
plot_grid_patches(data=None, style=None, ax=None, save_path=None, **style_kwargs)
¶
Plot hemisphere grid as colored patches in polar projection.
Parameters¶
data : np.ndarray, optional Data values per cell. If None, plots uniform grid. style : PolarPlotStyle, optional Styling configuration. If None, uses defaults. ax : matplotlib.axes.Axes, optional Existing polar axes to plot on. If None, creates new figure. save_path : Path or str, optional If provided, saves figure to this path **style_kwargs Override individual style parameters
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes with plot
Examples¶
fig, ax = viz.plot_grid_patches( ... data=vod_data, ... title="VOD Distribution", ... cmap='plasma', ... save_path="output.png" ... )
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
HemisphereVisualizer3D
¶
3D hemisphere visualization using plotly.
Creates interactive 3D plots with rotation, zoom, and hover capabilities. Designed for exploratory data analysis and presentations.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import HemisphereVisualizer3D
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) viz = HemisphereVisualizer3D(grid) fig = viz.plot_hemisphere_surface(data=vod_data, title="Interactive VOD") fig.show()
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
__init__(grid)
¶
Initialize 3D hemisphere visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
43 44 45 46 47 48 49 50 51 52 | |
plot_hemisphere_surface(data=None, style=None, title=None, colorscale='Viridis', opacity=0.8, show_wireframe=True, show_colorbar=True, width=800, height=600, **kwargs)
¶
Create 3D surface plot on hemisphere with actual cell patches.
Renders grid cells as colored 3D patches (not just points).
Parameters¶
data : np.ndarray, optional Data values per cell. If None, shows grid structure. style : PlotStyle, optional Styling configuration. If None, uses defaults. title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name opacity : float, default 0.8 Surface opacity (0=transparent, 1=opaque) show_wireframe : bool, default True Show grid lines on surface show_colorbar : bool, default True Display colorbar width : int, default 800 Figure width in pixels height : int, default 600 Figure height in pixels **kwargs Additional plotly trace parameters
Returns¶
plotly.graph_objects.Figure Interactive 3D figure with cell patches
Examples¶
fig = viz.plot_hemisphere_surface( ... data=vod_data, ... title="VOD Distribution 3D", ... colorscale='Plasma', ... opacity=0.9 ... ) fig.write_html("vod_3d.html")
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
plot_hemisphere_scatter(data=None, title=None, colorscale='Viridis', marker_size=6, opacity=0.8, width=800, height=600)
¶
Create 3D scatter plot of cell centers.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name marker_size : int or np.ndarray, default 6 Marker size (constant or per-point array) opacity : float, default 0.8 Marker opacity width : int, default 800 Figure width height : int, default 600 Figure height
Returns¶
plotly.graph_objects.Figure Interactive scatter plot
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | |
plot_cell_mesh(data=None, title=None, colorscale='Viridis', opacity=0.7, show_edges=True, width=800, height=600)
¶
Create 3D mesh plot showing cell boundaries.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name opacity : float, default 0.7 Mesh opacity show_edges : bool, default True Show cell edges width : int, default 800 Figure width height : int, default 600 Figure height
Returns¶
plotly.graph_objects.Figure Interactive mesh plot
Notes¶
This method requires grid cells with vertex information. Currently supports HTM and geodesic grids.
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | |
add_spherical_overlays(fig, elevation_rings=None, meridians_deg=None, overlay_color='lightgray', line_width=1)
¶
Add elevation rings and meridians to 3D plot.
Parameters¶
fig : plotly.graph_objects.Figure Existing 3D figure to add overlays to elevation_rings : list of int, optional Elevation angles in degrees. Default: [15, 30, 45, 60, 75, 90] meridians_deg : list of int, optional Meridian angles in degrees. Default: [0, 45, 90, 135, 180, 225, 270, 315] overlay_color : str, default 'lightgray' Color for overlay lines line_width : float, default 1 Width of overlay lines
Returns¶
fig : plotly.graph_objects.Figure Modified figure with overlays
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 | |
add_custom_axes(fig, axis_length=1.2, axis_color='black', show_labels=True)
¶
Add custom coordinate axes with labels.
Parameters¶
fig : plotly.graph_objects.Figure Existing 3D figure axis_length : float, default 1.2 Length of axis lines axis_color : str, default 'black' Color for axes show_labels : bool, default True Show axis labels (E, N, Z)
Returns¶
fig : plotly.graph_objects.Figure Modified figure with custom axes
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
PlotStyle
dataclass
¶
Unified styling configuration for both 2D and 3D plots.
Parameters¶
colormap : str, default 'viridis' Colormap name (matplotlib or plotly) colorscale : str, default 'Viridis' Plotly colorscale name background_color : str, default 'white' Background color text_color : str, default 'black' Text color grid_color : str, default 'lightgray' Grid line color font_family : str, default 'sans-serif' Font family font_size : int, default 11 Base font size title_size : int, default 14 Title font size label_size : int, default 12 Axis label font size edge_linewidth : float, default 0.5 Edge line width for cells opacity : float, default 0.8 3D surface opacity marker_size : int, default 8 3D marker size line_width : int, default 1 3D line width wireframe_opacity : float, default 0.2 3D wireframe transparency dark_mode : bool, default False Use dark theme
Source code in packages/canvod-viz/src/canvod/viz/styles.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
to_polar_style()
¶
Convert to PolarPlotStyle for 2D matplotlib plots.
Returns¶
PolarPlotStyle Equivalent 2D styling configuration
Source code in packages/canvod-viz/src/canvod/viz/styles.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
to_plotly_layout()
¶
Convert to plotly layout configuration.
Returns¶
dict Plotly layout settings
Source code in packages/canvod-viz/src/canvod/viz/styles.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
PolarPlotStyle
dataclass
¶
Configuration for 2D polar plot styling (matplotlib).
Parameters¶
cmap : str, default 'viridis' Matplotlib colormap name edgecolor : str, default 'black' Edge color for grid cells linewidth : float, default 0.5 Line width for cell edges alpha : float, default 1.0 Transparency (0=transparent, 1=opaque) vmin : float or None, optional Minimum value for colormap vmax : float or None, optional Maximum value for colormap title : str or None, optional Plot title figsize : tuple of float, default (10, 10) Figure size in inches (width, height) dpi : int, default 100 Dots per inch for figure colorbar_label : str, default 'Value' Label for colorbar colorbar_shrink : float, default 0.8 Colorbar size relative to axis colorbar_pad : float, default 0.1 Space between axis and colorbar colorbar_fontsize : int, default 11 Font size for colorbar label show_grid : bool, default True Show polar grid lines grid_alpha : float, default 0.3 Grid line transparency grid_linestyle : str, default '--' Grid line style show_degree_labels : bool, default True Show degree labels on radial axis theta_labels : list of int, default [0, 30, 60, 90] Elevation angles for labels (degrees)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
visualize_grid(grid, data=None, style=None, **kwargs)
¶
Visualize hemispherical grid in 2D polar projection.
Convenience function providing simple interface to 2D visualization.
Parameters¶
grid : HemiGrid Grid to visualize data : np.ndarray, optional Data values per cell. If None, plots uniform grid. style : PolarPlotStyle, optional Styling configuration. If None, uses defaults. **kwargs Additional style parameter overrides
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes object
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import visualize_grid
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) fig, ax = visualize_grid(grid, data=vod_data, cmap='viridis') plt.savefig("vod_plot.png", dpi=300)
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | |
visualize_grid_3d(grid, data=None, title=None, colorscale='Viridis', add_overlays=False, add_axes=False, **kwargs)
¶
Visualize hemispherical grid in 3D interactive plot.
Convenience function providing simple interface to 3D visualization.
Parameters¶
grid : HemiGrid Grid to visualize data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name add_overlays : bool, default False Add elevation rings and meridians add_axes : bool, default False Add custom coordinate axes **kwargs Additional parameters passed to plot_hemisphere_surface
Returns¶
fig : plotly.graph_objects.Figure Interactive 3D figure
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import visualize_grid_3d
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) fig = visualize_grid_3d( ... grid, ... data=vod_data, ... title="VOD 3D", ... add_overlays=True ... ) fig.show()
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 | |
add_tissot_indicatrix(ax, grid, radius_deg=None, n_sample=None, facecolor='gold', alpha=0.6, edgecolor='black', linewidth=0.5)
¶
Add Tissot's indicatrix circles to existing polar plot.
Adds equal-sized circles to visualize grid distortion. In equal-area grids, circles should appear roughly equal-sized. Variation indicates distortion.
Parameters¶
ax : matplotlib.axes.Axes Existing polar axis to add circles to grid : HemiGrid Grid instance radius_deg : float, optional Angular radius of circles in degrees. If None, auto-calculated as angular_resolution / 8. n_sample : int, optional Subsample cells (use every nth cell) for performance. If None, shows all cells. facecolor : str, default 'gold' Fill color for circles alpha : float, default 0.6 Transparency (0=transparent, 1=opaque) edgecolor : str, default 'black' Edge color for circles linewidth : float, default 0.5 Edge line width
Returns¶
ax : matplotlib.axes.Axes Modified axis with Tissot circles added
Examples¶
fig, ax = visualize_grid(grid, data=vod_data) add_tissot_indicatrix(ax, grid, radius_deg=3, n_sample=5) plt.savefig("vod_with_tissot.png")
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | |
create_publication_style()
¶
Create styling optimized for publication-quality figures.
Returns¶
PlotStyle Publication-optimized styling configuration
Examples¶
style = create_publication_style() viz.plot_2d(data=vod_data, style=style)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
create_interactive_style(dark_mode=True)
¶
Create styling optimized for interactive exploration.
Parameters¶
dark_mode : bool, default True Use dark theme for better screen viewing
Returns¶
PlotStyle Interactive-optimized styling configuration
Examples¶
style = create_interactive_style(dark_mode=True) viz.plot_3d(data=vod_data, style=style)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
Unified Visualizer¶
Unified hemisphere visualization API combining 2D and 3D capabilities.
Provides a single interface for both matplotlib (publication) and plotly (interactive) plots.
HemisphereVisualizer
¶
Unified hemisphere visualizer combining 2D and 3D capabilities.
Provides consistent API for both publication-quality matplotlib plots and interactive plotly visualizations. Handles styling coordination between different rendering backends.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
Create both 2D and 3D visualizations::
from canvod.grids import create_hemigrid
from canvod.viz import HemisphereVisualizer
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0)
viz = HemisphereVisualizer(grid)
# Publication-quality 2D plot
fig_2d, ax_2d = viz.plot_2d(
data=vod_data,
title="VOD Distribution",
save_path="publication.png"
)
# Interactive 3D plot
fig_3d = viz.plot_3d(
data=vod_data,
title="Interactive VOD Explorer"
)
fig_3d.show()
Switch styles easily::
# Publication style
pub_style = create_publication_style()
viz.set_style(pub_style)
fig, ax = viz.plot_2d(data=vod_data)
# Interactive style
int_style = create_interactive_style(dark_mode=True)
viz.set_style(int_style)
fig = viz.plot_3d(data=vod_data)
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
__init__(grid)
¶
Initialize unified visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
set_style(style)
¶
Set unified styling for both 2D and 3D plots.
Parameters¶
style : PlotStyle Styling configuration
Examples¶
pub_style = create_publication_style() viz.set_style(pub_style) fig, ax = viz.plot_2d(data=vod_data)
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
plot_2d(data=None, title=None, ax=None, save_path=None, style=None, **kwargs)
¶
Create 2D publication-quality plot.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title ax : matplotlib.axes.Axes, optional Existing axes to plot on save_path : Path or str, optional Save figure to this path style : PolarPlotStyle, optional Override default 2D style **kwargs Additional styling parameters
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes with plot
Examples¶
fig, ax = viz.plot_2d( ... data=vod_data, ... title="VOD Distribution", ... cmap='plasma', ... save_path="output.png", ... dpi=300 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
plot_3d(data=None, title=None, style=None, **kwargs)
¶
Create 3D interactive plot.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title style : PlotStyle, optional Override default 3D style **kwargs Additional plotly parameters
Returns¶
plotly.graph_objects.Figure Interactive 3D figure
Examples¶
fig = viz.plot_3d( ... data=vod_data, ... title="Interactive VOD", ... opacity=0.9, ... width=1000, ... height=800 ... ) fig.show() fig.write_html("interactive.html")
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
plot_3d_mesh(data=None, title=None, **kwargs)
¶
Create 3D mesh plot showing cell boundaries.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title **kwargs Additional plotly parameters
Returns¶
plotly.graph_objects.Figure Interactive mesh figure
Examples¶
fig = viz.plot_3d_mesh( ... data=vod_data, ... title="VOD Mesh View", ... opacity=0.7 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
create_comparison_plot(data=None, title_2d='2D Polar View', title_3d='3D Hemisphere View', save_2d=None, save_3d=None)
¶
Create both 2D and 3D plots for comparison.
Parameters¶
data : np.ndarray, optional Data values per cell title_2d : str, default "2D Polar View" Title for 2D plot title_3d : str, default "3D Hemisphere View" Title for 3D plot save_2d : Path or str, optional Save 2D figure to this path save_3d : Path or str, optional Save 3D figure to this path (HTML)
Returns¶
plot_2d : tuple of Figure and Axes 2D matplotlib plot plot_3d : plotly.graph_objects.Figure 3D plotly plot
Examples¶
(fig_2d, ax_2d), fig_3d = viz.create_comparison_plot( ... data=vod_data, ... save_2d="comparison_2d.png", ... save_3d="comparison_3d.html" ... ) plt.show() # Show 2D fig_3d.show() # Show 3D
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
create_publication_figure(data=None, title='Hemispherical Data Distribution', save_path=None, dpi=300, **kwargs)
¶
Create publication-ready figure with optimal styling.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, default "Hemispherical Data Distribution" Plot title save_path : Path or str, optional Save figure to this path dpi : int, default 300 Resolution in dots per inch **kwargs Additional styling parameters
Returns¶
fig : matplotlib.figure.Figure Publication-ready figure ax : matplotlib.axes.Axes Styled polar axes
Examples¶
fig, ax = viz.create_publication_figure( ... data=vod_data, ... title="VOD Distribution Over Rosalia Site", ... save_path="paper_figure_3.png", ... dpi=600 ... )
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
create_interactive_explorer(data=None, title='Interactive Data Explorer', dark_mode=True, save_html=None)
¶
Create interactive explorer with optimal settings.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, default "Interactive Data Explorer" Plot title dark_mode : bool, default True Use dark theme save_html : Path or str, optional Save HTML to this path
Returns¶
plotly.graph_objects.Figure Interactive explorer figure
Examples¶
fig = viz.create_interactive_explorer( ... data=vod_data, ... title="VOD Explorer", ... dark_mode=True, ... save_html="explorer.html" ... ) fig.show()
Source code in packages/canvod-viz/src/canvod/viz/visualizer.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
2D Visualization¶
2D hemisphere visualization using matplotlib for publication-quality plots.
Provides polar projection plotting of hemispherical grids with various rendering methods.
HemisphereVisualizer2D
¶
2D hemisphere visualization using matplotlib.
Creates publication-quality polar projection plots of hemispherical grids. Supports multiple grid types and rendering methods.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import HemisphereVisualizer2D
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) viz = HemisphereVisualizer2D(grid) fig, ax = viz.plot_grid_patches(data=vod_data, title="VOD Distribution") plt.savefig("vod_plot.png", dpi=300, bbox_inches='tight')
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
__init__(grid)
¶
Initialize 2D hemisphere visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
50 51 52 53 54 55 56 57 58 59 60 61 | |
plot_grid_patches(data=None, style=None, ax=None, save_path=None, **style_kwargs)
¶
Plot hemisphere grid as colored patches in polar projection.
Parameters¶
data : np.ndarray, optional Data values per cell. If None, plots uniform grid. style : PolarPlotStyle, optional Styling configuration. If None, uses defaults. ax : matplotlib.axes.Axes, optional Existing polar axes to plot on. If None, creates new figure. save_path : Path or str, optional If provided, saves figure to this path **style_kwargs Override individual style parameters
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes with plot
Examples¶
fig, ax = viz.plot_grid_patches( ... data=vod_data, ... title="VOD Distribution", ... cmap='plasma', ... save_path="output.png" ... )
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
visualize_grid(grid, data=None, style=None, **kwargs)
¶
Visualize hemispherical grid in 2D polar projection.
Convenience function providing simple interface to 2D visualization.
Parameters¶
grid : HemiGrid Grid to visualize data : np.ndarray, optional Data values per cell. If None, plots uniform grid. style : PolarPlotStyle, optional Styling configuration. If None, uses defaults. **kwargs Additional style parameter overrides
Returns¶
fig : matplotlib.figure.Figure Figure object ax : matplotlib.axes.Axes Polar axes object
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import visualize_grid
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) fig, ax = visualize_grid(grid, data=vod_data, cmap='viridis') plt.savefig("vod_plot.png", dpi=300)
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 | |
add_tissot_indicatrix(ax, grid, radius_deg=None, n_sample=None, facecolor='gold', alpha=0.6, edgecolor='black', linewidth=0.5)
¶
Add Tissot's indicatrix circles to existing polar plot.
Adds equal-sized circles to visualize grid distortion. In equal-area grids, circles should appear roughly equal-sized. Variation indicates distortion.
Parameters¶
ax : matplotlib.axes.Axes Existing polar axis to add circles to grid : HemiGrid Grid instance radius_deg : float, optional Angular radius of circles in degrees. If None, auto-calculated as angular_resolution / 8. n_sample : int, optional Subsample cells (use every nth cell) for performance. If None, shows all cells. facecolor : str, default 'gold' Fill color for circles alpha : float, default 0.6 Transparency (0=transparent, 1=opaque) edgecolor : str, default 'black' Edge color for circles linewidth : float, default 0.5 Edge line width
Returns¶
ax : matplotlib.axes.Axes Modified axis with Tissot circles added
Examples¶
fig, ax = visualize_grid(grid, data=vod_data) add_tissot_indicatrix(ax, grid, radius_deg=3, n_sample=5) plt.savefig("vod_with_tissot.png")
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_2d.py
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | |
3D Visualization¶
3D hemisphere visualization using plotly for interactive exploration.
Provides interactive 3D sphere surface plots with zoom, pan, and rotation capabilities.
HemisphereVisualizer3D
¶
3D hemisphere visualization using plotly.
Creates interactive 3D plots with rotation, zoom, and hover capabilities. Designed for exploratory data analysis and presentations.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import HemisphereVisualizer3D
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) viz = HemisphereVisualizer3D(grid) fig = viz.plot_hemisphere_surface(data=vod_data, title="Interactive VOD") fig.show()
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
__init__(grid)
¶
Initialize 3D hemisphere visualizer.
Parameters¶
grid : HemiGrid Hemisphere grid to visualize
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
43 44 45 46 47 48 49 50 51 52 | |
plot_hemisphere_surface(data=None, style=None, title=None, colorscale='Viridis', opacity=0.8, show_wireframe=True, show_colorbar=True, width=800, height=600, **kwargs)
¶
Create 3D surface plot on hemisphere with actual cell patches.
Renders grid cells as colored 3D patches (not just points).
Parameters¶
data : np.ndarray, optional Data values per cell. If None, shows grid structure. style : PlotStyle, optional Styling configuration. If None, uses defaults. title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name opacity : float, default 0.8 Surface opacity (0=transparent, 1=opaque) show_wireframe : bool, default True Show grid lines on surface show_colorbar : bool, default True Display colorbar width : int, default 800 Figure width in pixels height : int, default 600 Figure height in pixels **kwargs Additional plotly trace parameters
Returns¶
plotly.graph_objects.Figure Interactive 3D figure with cell patches
Examples¶
fig = viz.plot_hemisphere_surface( ... data=vod_data, ... title="VOD Distribution 3D", ... colorscale='Plasma', ... opacity=0.9 ... ) fig.write_html("vod_3d.html")
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
plot_hemisphere_scatter(data=None, title=None, colorscale='Viridis', marker_size=6, opacity=0.8, width=800, height=600)
¶
Create 3D scatter plot of cell centers.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name marker_size : int or np.ndarray, default 6 Marker size (constant or per-point array) opacity : float, default 0.8 Marker opacity width : int, default 800 Figure width height : int, default 600 Figure height
Returns¶
plotly.graph_objects.Figure Interactive scatter plot
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | |
plot_cell_mesh(data=None, title=None, colorscale='Viridis', opacity=0.7, show_edges=True, width=800, height=600)
¶
Create 3D mesh plot showing cell boundaries.
Parameters¶
data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name opacity : float, default 0.7 Mesh opacity show_edges : bool, default True Show cell edges width : int, default 800 Figure width height : int, default 600 Figure height
Returns¶
plotly.graph_objects.Figure Interactive mesh plot
Notes¶
This method requires grid cells with vertex information. Currently supports HTM and geodesic grids.
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | |
add_spherical_overlays(fig, elevation_rings=None, meridians_deg=None, overlay_color='lightgray', line_width=1)
¶
Add elevation rings and meridians to 3D plot.
Parameters¶
fig : plotly.graph_objects.Figure Existing 3D figure to add overlays to elevation_rings : list of int, optional Elevation angles in degrees. Default: [15, 30, 45, 60, 75, 90] meridians_deg : list of int, optional Meridian angles in degrees. Default: [0, 45, 90, 135, 180, 225, 270, 315] overlay_color : str, default 'lightgray' Color for overlay lines line_width : float, default 1 Width of overlay lines
Returns¶
fig : plotly.graph_objects.Figure Modified figure with overlays
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 | |
add_custom_axes(fig, axis_length=1.2, axis_color='black', show_labels=True)
¶
Add custom coordinate axes with labels.
Parameters¶
fig : plotly.graph_objects.Figure Existing 3D figure axis_length : float, default 1.2 Length of axis lines axis_color : str, default 'black' Color for axes show_labels : bool, default True Show axis labels (E, N, Z)
Returns¶
fig : plotly.graph_objects.Figure Modified figure with custom axes
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | |
visualize_grid_3d(grid, data=None, title=None, colorscale='Viridis', add_overlays=False, add_axes=False, **kwargs)
¶
Visualize hemispherical grid in 3D interactive plot.
Convenience function providing simple interface to 3D visualization.
Parameters¶
grid : HemiGrid Grid to visualize data : np.ndarray, optional Data values per cell title : str, optional Plot title colorscale : str, default 'Viridis' Plotly colorscale name add_overlays : bool, default False Add elevation rings and meridians add_axes : bool, default False Add custom coordinate axes **kwargs Additional parameters passed to plot_hemisphere_surface
Returns¶
fig : plotly.graph_objects.Figure Interactive 3D figure
Examples¶
from canvod.grids import create_hemigrid from canvod.viz import visualize_grid_3d
grid = create_hemigrid(grid_type='equal_area', angular_resolution=10.0) fig = visualize_grid_3d( ... grid, ... data=vod_data, ... title="VOD 3D", ... add_overlays=True ... ) fig.show()
Source code in packages/canvod-viz/src/canvod/viz/hemisphere_3d.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 | |
Styles¶
Styling configuration for visualizations.
Provides consistent styling across 2D matplotlib and 3D plotly visualizations, including publication-quality RSE journal style and colorscale utilities.
PolarPlotStyle
dataclass
¶
Configuration for 2D polar plot styling (matplotlib).
Parameters¶
cmap : str, default 'viridis' Matplotlib colormap name edgecolor : str, default 'black' Edge color for grid cells linewidth : float, default 0.5 Line width for cell edges alpha : float, default 1.0 Transparency (0=transparent, 1=opaque) vmin : float or None, optional Minimum value for colormap vmax : float or None, optional Maximum value for colormap title : str or None, optional Plot title figsize : tuple of float, default (10, 10) Figure size in inches (width, height) dpi : int, default 100 Dots per inch for figure colorbar_label : str, default 'Value' Label for colorbar colorbar_shrink : float, default 0.8 Colorbar size relative to axis colorbar_pad : float, default 0.1 Space between axis and colorbar colorbar_fontsize : int, default 11 Font size for colorbar label show_grid : bool, default True Show polar grid lines grid_alpha : float, default 0.3 Grid line transparency grid_linestyle : str, default '--' Grid line style show_degree_labels : bool, default True Show degree labels on radial axis theta_labels : list of int, default [0, 30, 60, 90] Elevation angles for labels (degrees)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
PlotStyle
dataclass
¶
Unified styling configuration for both 2D and 3D plots.
Parameters¶
colormap : str, default 'viridis' Colormap name (matplotlib or plotly) colorscale : str, default 'Viridis' Plotly colorscale name background_color : str, default 'white' Background color text_color : str, default 'black' Text color grid_color : str, default 'lightgray' Grid line color font_family : str, default 'sans-serif' Font family font_size : int, default 11 Base font size title_size : int, default 14 Title font size label_size : int, default 12 Axis label font size edge_linewidth : float, default 0.5 Edge line width for cells opacity : float, default 0.8 3D surface opacity marker_size : int, default 8 3D marker size line_width : int, default 1 3D line width wireframe_opacity : float, default 0.2 3D wireframe transparency dark_mode : bool, default False Use dark theme
Source code in packages/canvod-viz/src/canvod/viz/styles.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
to_polar_style()
¶
Convert to PolarPlotStyle for 2D matplotlib plots.
Returns¶
PolarPlotStyle Equivalent 2D styling configuration
Source code in packages/canvod-viz/src/canvod/viz/styles.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
to_plotly_layout()
¶
Convert to plotly layout configuration.
Returns¶
dict Plotly layout settings
Source code in packages/canvod-viz/src/canvod/viz/styles.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
Colorscale
dataclass
¶
Unified colorscale that converts between Plotly, matplotlib, and palettable.
Parameters¶
name : str
Colorscale identifier.
stops : list of (float, str)
Normalized [(position, color), ...] where position is 0–1.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | |
from_matplotlib(cmap_name, n_colors=256)
classmethod
¶
Create from a matplotlib colormap name.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
458 459 460 461 462 463 464 465 466 467 468 469 470 471 | |
from_colors(colors, name='custom')
classmethod
¶
Create from a list of color strings (hex, named, or rgb()).
Source code in packages/canvod-viz/src/canvod/viz/styles.py
473 474 475 476 477 478 | |
to_matplotlib(n_colors=256)
¶
Convert to a matplotlib LinearSegmentedColormap.
Returns¶
matplotlib.colors.Colormap
Source code in packages/canvod-viz/src/canvod/viz/styles.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
to_plotly()
¶
Return Plotly-compatible colorscale list.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
503 504 505 | |
create_publication_style()
¶
Create styling optimized for publication-quality figures.
Returns¶
PlotStyle Publication-optimized styling configuration
Examples¶
style = create_publication_style() viz.plot_2d(data=vod_data, style=style)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
create_rse_style()
¶
Create styling matching Remote Sensing of Environment journal guidelines.
Returns¶
PlotStyle RSE-compatible styling with Arial/Helvetica fonts, 300 DPI, inward ticks, and colorblind-friendly color cycle.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
create_interactive_style(dark_mode=True)
¶
Create styling optimized for interactive exploration.
Parameters¶
dark_mode : bool, default True Use dark theme for better screen viewing
Returns¶
PlotStyle Interactive-optimized styling configuration
Examples¶
style = create_interactive_style(dark_mode=True) viz.plot_3d(data=vod_data, style=style)
Source code in packages/canvod-viz/src/canvod/viz/styles.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
apply_rse_style()
¶
Apply RSE journal style globally via plt.rcParams.
Returns¶
dict The applied rcParams dictionary.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
rse_context()
¶
Return a context manager that temporarily applies RSE style.
Usage::
with rse_context():
fig, ax = plt.subplots()
...
Source code in packages/canvod-viz/src/canvod/viz/styles.py
353 354 355 356 357 358 359 360 361 362 363 364 365 | |
rse_style(func)
¶
Decorator that applies RSE style to a plotting function.
The decorated function is expected to return (fig, axes).
Source code in packages/canvod-viz/src/canvod/viz/styles.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
style_colorbar(cbar, label=None)
¶
Apply RSE-compatible styling to a matplotlib colorbar.
Parameters¶
cbar : matplotlib.colorbar.Colorbar Colorbar instance to style. label : str, optional Label text.
Returns¶
matplotlib.colorbar.Colorbar The styled colorbar.
Source code in packages/canvod-viz/src/canvod/viz/styles.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
fix_figure_for_dark_mode(fig, axes=None)
¶
Set explicit white backgrounds so figures render correctly in dark IDEs.
Parameters¶
fig : matplotlib.figure.Figure Figure to fix. axes : list, optional Specific axes; defaults to all axes in the figure.
Returns¶
matplotlib.figure.Figure
Source code in packages/canvod-viz/src/canvod/viz/styles.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |