Skip to content

Annotating throats at a certain location #2203

Answered by jgostick
mourendong asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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 = 

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mourendong
Comment options

@jgostick
Comment options

@mourendong
Comment options

Answer selected by mourendong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants