The [basic usage](basic_usage.md) page shows how to run a simulation and get outputs, here we want to show how a script with some more advanced reading in and writing out of data would look like with some customized plotting.
If you wish to make your own plots we recommend the user to learn how to use [matplotlib](https://matplotlib.org/) and/or [xarrays](https://docs.xarray.dev/en/stable/).
**Note: pythermogis has been made to enable users to run doublet simulations; it is not our goal to make lots of customised plotting functions.
The reason is that when it comes to plotting users have a specific idea of how they want their plots to look and it is hard to cater to everyone. It is better for us to give you the tools to run the simulations and let you design your plots
yourselves.**
Here is an example which:
1. reads in grids of: mean thickness, thickness standard deviation, net-to-gross, porosity, mean permeability, ln(permeability) standard deviation
2. runs a doublet simulations and calculates economics across all the non-nan cells of the grids for p-values of 10%-90% (with increments of 10%)
3. writes the results out to file
4. plots maps of power, capex and npv for the pvalues: 10%, 50%, 90%
5. plots the npv curve for a single location on the grids
The example input data can be found in the `/resoureces/example_data` directory in the repository.
plot_grid(results_p_value[variable],axes=axes[i,j],add_netherlands_shapefile=True)# See documentation on plot_grid in pygridsio, you can also provide your own shapefile
plt.tight_layout()# ensure there is enough spacing
plt.savefig(output_data_path/"maps.png")
# plot net-present value at a single location as a function of p-value and find the probability of success
x,y=85e3,440e3# define location
results_loc=results.sel(x=x,y=y,method="nearest")
# probability of success is defined as the p-value where npv = 0.0, use interpolation to find pos:
pos=np.interp(0.0,results_loc.npv[::-1],results_loc.p_value[::-1])# The order of the npv data has to be reversed as np.interp requires values to increase to function properly
# plot npv versus p-value and a map showing the location of interest