You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is that possible to fill the space between the contour lines using hachure patterns? Or use them in grdimage? #3259
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.
👋 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.
changed the title [-]Is that possible to fill hachure patterns between the contour lines? Or use them in grdimage?[/-][+]Is that possible to fill between the contour lines using hachure patterns? Or use them in grdimage?[/+]on May 18, 2024
changed the title [-]Is that possible to fill between the contour lines using hachure patterns? Or use them in grdimage?[/-][+]Is that possible to fill the space between the contour lines using hachure patterns? Or use them in grdimage?[/+]on May 18, 2024
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.
importpygmt# -----------------------------------------------------------------------------# (I) cmap with colors - allowedfig=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: +p8fig=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()
Activity
welcome commentedon May 18, 2024
👋 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.
[-]Is that possible to fill hachure patterns between the contour lines? Or use them in grdimage?[/-][+]Is that possible to fill between the contour lines using hachure patterns? Or use them in grdimage?[/+][-]Is that possible to fill between the contour lines using hachure patterns? Or use them in grdimage?[/-][+]Is that possible to fill the space between the contour lines using hachure patterns? Or use them in grdimage?[/+]seisman commentedon May 19, 2024
Can you please show some examples so that we can understand the feature request better?
phalucy commentedon May 19, 2024
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)
I think the hatching patterns in those figures may be done by contourf function in matplotlib (https://matplotlib.org/stable/gallery/images_contours_and_fields/contourf_hatching.html) or contour effects in NCL (https://www.ncl.ucar.edu/Applications/coneff.shtml; see the example [coneff_13.ncl]).
seisman commentedon May 20, 2024
It seems a nice feature but may be not easy to implement.
yvonnefroehlich commentedon May 21, 2024
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.