# Mesh plot problem

**URL:** <https://openmc.discourse.group/t/mesh-plot-problem/462>\
**Category:** User Support\
**Created:** [July 22, 2019, 3:29pm UTC](https://openmc.discourse.group/t/mesh-plot-problem/462 "2019-07-22T15:29:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![YimingZ](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@YimingZ](https://openmc.discourse.group/u/YimingZ)\
**Post date:** [July 22, 2019, 3:29pm UTC](https://openmc.discourse.group/t/mesh-plot-problem/462/1 "2019-07-22T15:29:05Z")

</div>

Hi everyone,

I met a strange problem when I was using mesh tally to present the neutron flux distribution. The geometry of this model is four UO2 assemblies array surrounded by water, and a 2D mesh tally was defined to cover the assemblies and water region. But in the results visualization process, the assemblies appeared at different areas with the geometry definition.

I tried to redefine the mesh plot and check the codes, but I can not find a clue to fix it. I’ll put the geometry plot, mesh plot and the tally setting files in the attachment. If anybody knows where is the problem, please let me know.

_# Load the statepoint file_  
_sp=openmc.StatePoint(‘statepoint.200.h5’)_

_tally=sp.get\_tally(name=‘flux tally’)_

_flux=tally.get\_slice(scores=[‘flux’])_  
_thermal\_flux=flux.get\_slice(filters=[openmc.EnergyFilter], filter\_bins=[((0, 0.625),)])_

_thermal\_flux.mean.shape=(173,173)_  
_plt.figure()_  
_plt.imshow(thermal\_flux.mean, interpolation=‘none’)_  
_plt.colorbar()_

Above is part of the results visualization code. If there is something error here, please let me know. Thanks for your help in advance.

Best wishes,

Yiming

 ![PWR_assembly.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/1X/2eb13c84c1bf3b51a53d7fa9c415c08666456c93.png)

[tallies.xml](https://openmc.discourse.group/uploads/short-url/8zoNKQXt1Jqzni1gfPlbMS3Cxsh.xml) (533 Bytes)

[tallies.out](https://openmc.discourse.group/uploads/short-url/kOnx8mYDeWCON71E7km224aEDj4.out) (733 KB)

![thermal_neutron_flux.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/1X/7557e659585c05664b5a692359418bad98033249.png)

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [July 22, 2019, 8:21pm UTC](https://openmc.discourse.group/t/mesh-plot-problem/462/2 "2019-07-22T20:21:09Z")

</div>

Hi Yiming,

The [imshow](https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.imshow.html) function in matplotlib default to putting the (0,0) value in the upper-left corner rather than the lower-left. If you pass the keyword argument origin=‘lower’ to imshow, it will vertically flip the image to match what the data that OpenMC gives you.

Best regards,  
Paul
