mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Merge pull request #2 from shimwell/adding_legend_test
plt test includes legend with rgb color
This commit is contained in:
commit
b4a6c0419d
1 changed files with 16 additions and 9 deletions
|
|
@ -48,18 +48,25 @@ def test_bounding_box():
|
|||
assert_unbounded(u)
|
||||
|
||||
|
||||
def test_plot(run_in_tmpdir, sphere_model):
|
||||
m = sphere_model.materials[0]
|
||||
univ = sphere_model.geometry.root_universe
|
||||
def test_plot(run_in_tmpdir):
|
||||
|
||||
pincell = openmc.examples.pwr_pin_cell()
|
||||
materials = pincell.materials
|
||||
|
||||
mat_colors = {
|
||||
materials[0]: (200, 1, 1),
|
||||
materials[1]: "gray",
|
||||
materials[2]: "limegreen"
|
||||
}
|
||||
|
||||
colors = {m: 'limegreen'}
|
||||
for basis in ('xy', 'yz', 'xz'):
|
||||
univ.plot(
|
||||
basis=basis,
|
||||
pincell.geometry.root_universe.plot(
|
||||
colors=mat_colors,
|
||||
color_by="material",
|
||||
legend=True,
|
||||
pixels=(10, 10),
|
||||
color_by='material',
|
||||
colors=colors,
|
||||
outline=True,
|
||||
basis=basis,
|
||||
outline=True
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue