# Plotting cylindrical mesh flux

**URL:** <https://openmc.discourse.group/t/plotting-cylindrical-mesh-flux/5254>\
**Category:** User Support\
**Created:** [February 18, 2025, 2:15pm UTC](https://openmc.discourse.group/t/plotting-cylindrical-mesh-flux/5254 "2025-02-18T14:15:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![www.ebba.com](https://avatars.discourse-cdn.com/v4/letter/w/b77776/32.png) [@www.ebba.com](https://openmc.discourse.group/u/www.ebba.com)\
**Post date:** [February 18, 2025, 2:15pm UTC](https://openmc.discourse.group/t/plotting-cylindrical-mesh-flux/5254/1 "2025-02-18T14:15:34Z")

</div>

Hi!

I am having problems plotting a slice of my cylindrical mesh.

I define the mesh like so:

mesh\_bins\_r = 100  
mesh\_bins\_theta = 1  
mesh\_bins\_z = 1

mesh = omc.CylindricalMesh.from\_domain(domain=my\_geometry,  
dimension=[mesh\_bins\_r, mesh\_bins\_theta, mesh\_bins\_z])  
mesh\_filter = omc.MeshFilter(mesh)

And then I would like to plot a flux map, but I think there is a problem with going from polar to cartesian coordinates. I was going for something like this:

with omc.StatePoint(f’statepoint\_file.h5’) as sp:  
flux\_tally = sp.get\_tally(name=“flux tally”)

tally\_mesh = flux\_tally.find\_filter(omc.MeshFilter).mesh  
tally\_mesh\_extent = tally\_mesh.bounding\_box.extent[‘xy’]

flux\_mean = flux\_tally.get\_reshaped\_data(value=‘mean’, expand\_dims=True).squeeze()

plt.figure(figsize=(10, 6))  
plt.imshow(  
flux\_mean.T,  
origin=“lower”,  
extent=tally\_mesh\_extent,  
norm=LogNorm(),  
)  
plt.title(“Flux Mean”)  
plt.show()

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 18, 2025, 7:47pm UTC](https://openmc.discourse.group/t/plotting-cylindrical-mesh-flux/5254/2 "2025-02-18T19:47:30Z")

</div>

The source code from this openmc\_cylindrical\_mesh\_plotter package might help

> **[GitHub - fusion-energy/openmc\_cylindrical\_mesh\_plotter: Plots slices of openmc cylindrical mesh tallies...](https://github.com/fusion-energy/openmc_cylindrical_mesh_plotter)**
>
> Plots slices of openmc cylindrical mesh tallies results

---

<div class="post-metadata">

**Author:** ![www.ebba.com](https://avatars.discourse-cdn.com/v4/letter/w/b77776/32.png) [@www.ebba.com](https://openmc.discourse.group/u/www.ebba.com)\
**Post date:** [February 25, 2025, 3:15pm UTC](https://openmc.discourse.group/t/plotting-cylindrical-mesh-flux/5254/3 "2025-02-25T15:15:26Z")

</div>

Thank you! I think I got it working now 😄
