# Math domain error in openmc\_plot

**URL:** <https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176>\
**Category:** User Support\
**Created:** [April 20, 2024, 2:54am UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176 "2024-04-20T02:54:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogesh](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yogesh/32/2841_2.png) [@yogesh](https://openmc.discourse.group/u/yogesh)\
**Post date:** [April 20, 2024, 2:54am UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/1 "2024-04-20T02:54:24Z")

</div>

Hi all,

I am trying to visualize a geometry via a xml file but I am receiving math domain error. I have made changes to best of my understanding but I can not locate the problem. I would appreciate some assistance.

Attached is the screenshot of the error

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/3/3076f49e022f343bb220c21988bef6db958e37c2.png)

---

<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:** [April 20, 2024, 6:59am UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/2 "2024-04-20T06:59:16Z")

</div>

Would you be able to upload the xml file and i can take a look.

Thanks

---

<div class="post-metadata">

**Author:** ![yogesh](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yogesh/32/2841_2.png) [@yogesh](https://openmc.discourse.group/u/yogesh)\
**Post date:** [April 20, 2024, 8:41pm UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/3 "2024-04-20T20:41:25Z")

</div>

Hello Dr. Shimwell,

Please find the attached file.  
[geometry.xml](https://openmc.discourse.group/uploads/short-url/yDovaxHgNtFuyCAgPCqd9tNb0NK.xml) (31.8 KB)

Also,  
what is the correct syntax for the usage of class methods, in this instance class method from\_geometry in openmc.Plot()? Are the variables for Plot still necessary or would it take default values?  
another class method example would be the class method from\_xml in openmc.Geometry()

Thank you

---

<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:** [April 21, 2024, 2:26am UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/4 "2024-04-21T02:26:09Z")

</div>

Looks like a bug in openmc\_geometry\_plot which I think is fixed now. If possible could you install the new version and try again please. Apologies for the bug

```auto
pip install openmc_geometry_plot==0.4.3
openmc_geometry_plot

```

openmc was unable to automatically find a bounding box for the geometry so it does need the axis values manually changing to zoom in a bit from the default 2000 values

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/e/ee7812cb313d87f645fa164d8e5430c1c677d60b.png)

---

<div class="post-metadata">

**Author:** ![yogesh](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yogesh/32/2841_2.png) [@yogesh](https://openmc.discourse.group/u/yogesh)\
**Post date:** [April 21, 2024, 3:28pm UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/5 "2024-04-21T15:28:18Z")

</div>

Dr Shimwell,

Thank you for the solution. I was able to get the plotter working but any changes made in the axis values aborts the link. Also, I was curious if you saw my syntax question in the previous message.

 ![image](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/f/fd981c5c7ad13576b9dd166659e5d94c30bcb01f.png)

---

<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:** [April 21, 2024, 6:51pm UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/6 "2024-04-21T18:51:30Z")

</div>

I’ve not seen that error and can’t seam to reproduce it over here. I’m running openmc develop branch if that helps.

---

<div class="post-metadata">

**Author:** ![yogesh](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yogesh/32/2841_2.png) [@yogesh](https://openmc.discourse.group/u/yogesh)\
**Post date:** [April 22, 2024, 2:59am UTC](https://openmc.discourse.group/t/math-domain-error-in-openmc-plot/4176/7 "2024-04-22T02:59:30Z")

</div>

I tried it on the develop branch and 0.14 and 0.13.3 versions as well, but the problem has persisted. Is there a way I could assign the axis values from somewhere inside the code?
