Skip to content

Commit c20c0c3

Browse files
author
Lisa Malenfant
committed
Fixed the error for the log plotting
1 parent 4baaa65 commit c20c0c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripting/monte_carlo/demo_01_r_of_rho_simple.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"clr.AddReference(publish_local) # Copy the VTS dlls into the libraries folders\n",
3333
"import numpy as np\n",
3434
"import plotly.graph_objects as go\n",
35+
"import plotly.express as px\n",
3536
"from Vts import *\n",
3637
"from Vts.Common import *\n",
3738
"from Vts.Extensions import *\n",
@@ -76,7 +77,7 @@
7677
"# plot the results using Plotly\n",
7778
"detectorResults = Array.CreateInstance(ROfRhoDetector,1)\n",
7879
"detectorResults[0] = simulationOutput.ResultsDictionary[\"ROfRho\"]\n",
79-
"logReflectance = [np.log(r) for r in detectorResults[0].Mean]\n",
80+
"logReflectance = [r for r in detectorResults[0].Mean]\n",
8081
"detectorMidpoints = [mp for mp in detectorRange.AsEnumerable()]\n",
8182
"\n",
8283
"xLabel = \"ρ [mm]\"\n",
@@ -85,6 +86,7 @@
8586
"chart = go.Figure()\n",
8687
"chart.add_trace(go.Scatter(x=detectorMidpoints, y=logReflectance, mode='lines+markers'))\n",
8788
"chart.update_layout( title=\"log(R(ρ)) [mm-2]\", xaxis_title=xLabel, yaxis_title=yLabel)\n",
89+
"chart.update_yaxes(type=\"log\")\n",
8890
"chart.show()\n"
8991
]
9092
},

0 commit comments

Comments
 (0)