@@ -251,6 +251,7 @@ def plot(
251
251
hlim : Optional [tuple [float , float ]] = None ,
252
252
vlim : Optional [tuple [float , float ]] = None ,
253
253
fill_structures : bool = True ,
254
+ transpose : bool = False ,
254
255
** patch_kwargs ,
255
256
) -> Ax :
256
257
"""Plot each of simulation's components on a plane defined by one nonzero x,y,z coordinate.
@@ -282,23 +283,23 @@ def plot(
282
283
"""
283
284
284
285
hlim , vlim = Scene ._get_plot_lims (
285
- bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
286
+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
286
287
)
287
288
288
289
ax = self .scene .plot_structures (
289
- ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , fill = fill_structures
290
+ ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , fill = fill_structures , transpose = transpose
290
291
)
291
- ax = self .plot_sources (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , alpha = source_alpha )
292
- ax = self .plot_monitors (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , alpha = monitor_alpha )
292
+ ax = self .plot_sources (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , alpha = source_alpha , transpose = transpose )
293
+ ax = self .plot_monitors (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , alpha = monitor_alpha , transpose = transpose )
293
294
ax = Scene ._set_plot_bounds (
294
- bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim
295
+ bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
295
296
)
296
- ax = self .plot_boundaries (ax = ax , x = x , y = y , z = z )
297
- ax = self .plot_symmetries (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim )
297
+ ax = self .plot_boundaries (ax = ax , x = x , y = y , z = z , transpose = transpose )
298
+ ax = self .plot_symmetries (ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose )
298
299
299
300
# Add the default axis labels, tick labels, and title
300
301
ax = Box .add_ax_labels_and_title (
301
- ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units
302
+ ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units , transpose = transpose
302
303
)
303
304
304
305
return ax
@@ -314,6 +315,7 @@ def plot_sources(
314
315
vlim : Optional [tuple [float , float ]] = None ,
315
316
alpha : Optional [float ] = None ,
316
317
ax : Ax = None ,
318
+ transpose : bool = False ,
317
319
) -> Ax :
318
320
"""Plot each of simulation's sources on a plane defined by one nonzero x,y,z coordinate.
319
321
@@ -341,13 +343,13 @@ def plot_sources(
341
343
"""
342
344
bounds = self .bounds
343
345
for source in self .sources :
344
- ax = source .plot (x = x , y = y , z = z , alpha = alpha , ax = ax , sim_bounds = bounds )
346
+ ax = source .plot (x = x , y = y , z = z , alpha = alpha , ax = ax , sim_bounds = bounds , transpose = transpose )
345
347
ax = Scene ._set_plot_bounds (
346
- bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim
348
+ bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
347
349
)
348
350
# Add the default axis labels, tick labels, and title
349
351
ax = Box .add_ax_labels_and_title (
350
- ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units
352
+ ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units , transpose = transpose
351
353
)
352
354
return ax
353
355
@@ -362,6 +364,7 @@ def plot_monitors(
362
364
vlim : Optional [tuple [float , float ]] = None ,
363
365
alpha : Optional [float ] = None ,
364
366
ax : Ax = None ,
367
+ transpose : bool = False ,
365
368
) -> Ax :
366
369
"""Plot each of simulation's monitors on a plane defined by one nonzero x,y,z coordinate.
367
370
@@ -389,13 +392,13 @@ def plot_monitors(
389
392
"""
390
393
bounds = self .bounds
391
394
for monitor in self .monitors :
392
- ax = monitor .plot (x = x , y = y , z = z , alpha = alpha , ax = ax , sim_bounds = bounds )
395
+ ax = monitor .plot (x = x , y = y , z = z , alpha = alpha , ax = ax , sim_bounds = bounds , transpose = transpose )
393
396
ax = Scene ._set_plot_bounds (
394
- bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim
397
+ bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
395
398
)
396
399
# Add the default axis labels, tick labels, and title
397
400
ax = Box .add_ax_labels_and_title (
398
- ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units
401
+ ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units , transpose = transpose
399
402
)
400
403
return ax
401
404
@@ -409,6 +412,7 @@ def plot_symmetries(
409
412
hlim : Optional [tuple [float , float ]] = None ,
410
413
vlim : Optional [tuple [float , float ]] = None ,
411
414
ax : Ax = None ,
415
+ transpose : bool = False ,
412
416
) -> Ax :
413
417
"""Plot each of simulation's symmetries on a plane defined by one nonzero x,y,z coordinate.
414
418
@@ -432,21 +436,21 @@ def plot_symmetries(
432
436
matplotlib.axes._subplots.Axes
433
437
The supplied or created matplotlib axes.
434
438
"""
435
-
439
+ 9
436
440
normal_axis , _ = Box .parse_xyz_kwargs (x = x , y = y , z = z )
437
441
438
442
for sym_axis , sym_value in enumerate (self .symmetry ):
439
443
if sym_value == 0 or sym_axis == normal_axis :
440
444
continue
441
445
sym_box = self ._make_symmetry_box (sym_axis = sym_axis )
442
446
plot_params = self ._make_symmetry_plot_params (sym_value = sym_value )
443
- ax = sym_box .plot (x = x , y = y , z = z , ax = ax , ** plot_params .to_kwargs ())
447
+ ax = sym_box .plot (x = x , y = y , z = z , ax = ax , transpose = transpose , ** plot_params .to_kwargs ())
444
448
ax = Scene ._set_plot_bounds (
445
- bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim
449
+ bounds = self .simulation_bounds , ax = ax , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
446
450
)
447
451
# Add the default axis labels, tick labels, and title
448
452
ax = Box .add_ax_labels_and_title (
449
- ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units
453
+ ax = ax , x = x , y = y , z = z , plot_length_units = self .plot_length_units , transpose = transpose
450
454
)
451
455
return ax
452
456
@@ -482,6 +486,7 @@ def plot_boundaries(
482
486
y : Optional [float ] = None ,
483
487
z : Optional [float ] = None ,
484
488
ax : Ax = None ,
489
+ transpose : bool = False ,
485
490
** kwargs ,
486
491
) -> Ax :
487
492
"""Plot the simulation boundary conditions as lines on a plane
@@ -519,6 +524,7 @@ def plot_structures(
519
524
hlim : Optional [tuple [float , float ]] = None ,
520
525
vlim : Optional [tuple [float , float ]] = None ,
521
526
fill : bool = True ,
527
+ transpose : bool = False ,
522
528
) -> Ax :
523
529
"""Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
524
530
@@ -545,11 +551,11 @@ def plot_structures(
545
551
"""
546
552
547
553
hlim_new , vlim_new = Scene ._get_plot_lims (
548
- bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
554
+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
549
555
)
550
556
551
557
return self .scene .plot_structures (
552
- x = x , y = y , z = z , ax = ax , hlim = hlim_new , vlim = vlim_new , fill = fill
558
+ x = x , y = y , z = z , ax = ax , hlim = hlim_new , vlim = vlim_new , fill = fill , transpose = transpose
553
559
)
554
560
555
561
@equal_aspect
@@ -566,6 +572,7 @@ def plot_structures_eps(
566
572
ax : Ax = None ,
567
573
hlim : Optional [tuple [float , float ]] = None ,
568
574
vlim : Optional [tuple [float , float ]] = None ,
575
+ transpose : bool = False ,
569
576
) -> Ax :
570
577
"""Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
571
578
The permittivity is plotted in grayscale based on its value at the specified frequency.
@@ -603,7 +610,7 @@ def plot_structures_eps(
603
610
"""
604
611
605
612
hlim , vlim = Scene ._get_plot_lims (
606
- bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
613
+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
607
614
)
608
615
609
616
return self .scene .plot_structures_eps (
@@ -617,6 +624,7 @@ def plot_structures_eps(
617
624
hlim = hlim ,
618
625
vlim = vlim ,
619
626
reverse = reverse ,
627
+ transpose = transpose ,
620
628
)
621
629
622
630
@equal_aspect
@@ -632,6 +640,7 @@ def plot_structures_heat_conductivity(
632
640
ax : Ax = None ,
633
641
hlim : Optional [tuple [float , float ]] = None ,
634
642
vlim : Optional [tuple [float , float ]] = None ,
643
+ transpose : bool = False ,
635
644
) -> Ax :
636
645
"""Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.
637
646
The permittivity is plotted in grayscale based on its value at the specified frequency.
@@ -669,7 +678,7 @@ def plot_structures_heat_conductivity(
669
678
"""
670
679
671
680
hlim , vlim = Scene ._get_plot_lims (
672
- bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim
681
+ bounds = self .simulation_bounds , x = x , y = y , z = z , hlim = hlim , vlim = vlim , transpose = transpose
673
682
)
674
683
675
684
return self .scene .plot_structures_heat_conductivity (
@@ -682,6 +691,7 @@ def plot_structures_heat_conductivity(
682
691
hlim = hlim ,
683
692
vlim = vlim ,
684
693
reverse = reverse ,
694
+ transpose = transpose ,
685
695
)
686
696
687
697
@classmethod
0 commit comments