gimli-org / gimli

Geophysical Inversion and Modeling Library :earth_africa:
https://www.pygimli.org
Other
348 stars 131 forks source link

Change colormap of `TravelTimeManager.showRayPaths` #609

Closed kerim371 closed 7 months ago

kerim371 commented 7 months ago

Problem description

Can't understand how to modify colormap of TravelTimeManager.showRayPaths. For example I calculated travel times and I want to display updated model along with raypaths:

fig, ax = pg.plt.subplots()
ax, cbar = mgr.showRayPaths(ax=ax, showMesh=False, diam=0.01)

But displayed image uses default colormap. How can I set it to 'jet' for example?

image

Your environment

Please provide the output of print(pygimli.Report()) here. If that does not work, please give provide some additional information on your:

Operating system: Linux Python version: 3.10.12 pyGIMLi version: 1.4.3

halbmy commented 7 months ago

showRayPaths just plots the rays on some existing axis ax that was created before, e.g. by ax, cbar = mgr.showResult() to which you can pass arguments like cMap='jet', cMin/cMax etc.

Note that jet has been proven to be a very bad color map (https://mycartablog.com/tag/jet/) so better use a perceptual one or at least something like Spectral_r if it needs to be rainbow.

kerim371 commented 7 months ago

@halbmy oh I see... Thank you very much!

And also Spectral_r looks more attractive and more similar to the ground from my view :)