Open EvanBianco opened 9 years ago
Very cool. To clarify: you see this replacing the existing method or drawing patches?
It seems like there could be a problem with interpolation — just like with the usual way to paint lithologies on curves using a colourmap, at most resolutions, you end up with colours between the discrete colours, when in fact you want it to change abruptly.
I guess it is possible to paint/fill with a different curve? How would the striplog data (say, lithologies) have to look to paint with that? Would it have to be a curve, essentially? Can we pain with arbitrary (i.e. legend) colours, or would we have to make a fake colourmap that maps to the legend?
I propose that this is a better way to draw logs using patches. Yes I think we can paint with arbitrary colours. It's really a better way of sculpting a striplog with a log (like we do in the feature plot of geotransect). Instead of creating a white mask over an image, we are creating a clipped path (defined by a log curve) around an image (which we may want to be a striplog, but can be any image), which allows it to be inserted on top of other stuff (on a seismic image say).
To be clear, the color-filled image can be anything we want (just as before), and we can use clip it using any log (it could be the striplog variable width, or it could be a fixed width "bar".
In this example, I am "painting" with an entirely different set of data than the log. I'll work up an example with an actual striplog.
It does potentially mean re-writing the striplog.plot() method, to handle option keyword arguments for logs to sculpt with say.
In the code snippet above, we are doing clip_path, on im which is an axes object, so that might be the thing we need to return striplog.plot(), or perhaps it needs some other method?
im.set_clip_path(patch)
BTW: this method / trick was shared by Joe K.
The most recent implementations of Striplog allows one to return the figure from
striplog.plot()
. If we can get the axes for the stiplog figure, then we can sculpt is using PathPatches. This will make drawing the feature plot faster, it will also allow easier overlay of the striplog on cross-sections.