Annotating throats at a certain location #2203
Answered
by
jgostick
mourendong
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
jgostick
Nov 30, 2021
Replies: 1 comment 3 replies
-
You have a few options, but they all involve finding the [x,y,z] points you want to plot, so let's start there. For each throat in the network you can find it's centroid (as the average of the neighbor) using To plot them you can either (a) add them to your network (mangling your current network) (b) create a new network and plot them together or (c) update a custom version of our plot function to add them. I think option b is the best bet: pn = op.network.Cubic([5, 5, 1])
crds = np.mean(pn.coords[pn.conns], axis=1)
pn2 = op.network.GenericNetwork(Np=crds.shape[0], Nt=0)
pn2['pore.coords'] = crds
ax = op.topotools.plot_coordinates(pn, c='g')
ax = op.topotools.plot_connections(pn, ax=ax)
ax = op.topotools.plot_coordinates(pn2, ax=ax, c='r') |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
mourendong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have a few options, but they all involve finding the [x,y,z] points you want to plot, so let's start there. For each throat in the network you can find it's centroid (as the average of the neighbor) using
crds = np.mean(pn.coords[pn.conns], axis=1)
To plot them you can either (a) add them to your network (mangling your current network) (b) create a new network and plot them together or (c) update a custom version of our plot function to add them. I think option b is the best bet: