-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is that possible to fill the space between the contour lines using hachure patterns? Or use them in grdimage? #3259
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct. |
Can you please show some examples so that we can understand the feature request better? |
Hi, thanks for reply. Please find the example figures in the following paper: https://www.nature.com/articles/s41467-022-31676-8 (see Figs. 1-3) |
It seems a nice feature but may be not easy to implement. |
Maybe a first step would be to allow patterns when setting up a custom colormap. Probably, this is something that has to be implemented directly in GMT. import pygmt
# -----------------------------------------------------------------------------
# (I) cmap with colors - allowed
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -1, 1], projection="X10c/2c", frame=0)
pygmt.makecpt(cmap="lightorange,orange,red,darkred", series=[0, 4, 1])
fig.colorbar(cmap=True, position="jMC+h", frame=True)
fig.show()
# %%
# -----------------------------------------------------------------------------
# (II) cmap with pattern - not available
# GMTCLibError: Module 'makecpt' failed with status code 8:
# makecpt [ERROR]: Badly formatted color entry: +p8
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -1, 1], projection="X10c/2c", frame=0)
pygmt.makecpt(cmap="p8,p17,p15,p25", series=[0, 4, 1])
fig.colorbar(cmap=True, position="jMC+h", frame=True)
fig.show() |
Description of the desired feature
In many geo-related fields, we need to plot spatial distributions of composite values or trends together with their significant levels.
Many papers have those kinds of maps by showing the levels with dots/hatchure patterns.
However, I don't know there is a way to reproduce those figures with hatched significant fields in GMT.
Is there any way to plot some patterns/dots/lines over the significant values?
One potential way may be creating a grd file by replacing insignificant values with NaNs. Then, I could use grdimage to plot it using cmap, which contains hachure patterns instead of normal colors. But for now, I don't know how to do so, because hacure patterns only works when 'fill' or '-G' function is available.
By the way, the GMT example 16 (https://docs.generic-mapping-tools.org/dev/gallery/ex16.html) showed a way to use hatched cpt and grdview, but it is not 'elegent' way because we need to edit the cpt file manually. I think it could be possible to include such function inside the codes of GMT/PyGMT.
Are you willing to help implement and maintain this feature?
No
The text was updated successfully, but these errors were encountered: