Skip to content

Conversation

@yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Dec 24, 2024

This PR adds a JN for backgroundmaps:

  • Figure.coast: land and water masses, shorelines
  • Downloade one of the GMT remote datasets and plot it via Figure.grdimage
  • Downloade tiled maps using contextily and plot it via Figure.tilemaps
  • 3-D map via Figure.grdview

Preview:
Fig3_PyGMT_backgrounds

@gitnotebooks
Copy link

gitnotebooks bot commented Dec 24, 2024

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/GenericMappingTools/pygmt-paper-figures/pull/8

@seisman
Copy link
Member

seisman commented Apr 22, 2025

@yvonnefroehlich What about extending this example to include more basemap types? Below are four basemaps that can fit in a 2x2 subplot layout.

  • A coastline-type basemap, with coastlines, and colored land/ocean
  • A topographic map [Already in the example]
  • A tilemap-style basemap [Already in the example]
  • Another map that uses one of the remote dataset (e.g., earth_day/earth_geoid) or a contour map?

Users unfamiliar with GMT can get a first impression of the types of basemaps PyGMT offers, while experienced GMT users can discover that PyGMT supports tilemap-style basemaps.

Please let me know that you think and I'd like to help if you don't have time to work on it.

@yvonnefroehlich
Copy link
Member Author

@yvonnefroehlich What about extending this example to include more basemap types? Below are four basemaps that can fit in a 2x2 subplot layout.

  • A coastline-type basemap, with coastlines, and colored land/ocean

There is already an example for Figure.coast (PR #1, https://github.com/GenericMappingTools/pygmt-paper-figures/blob/main/basic-map.ipynb). Do we want to replace this separate example and include it in this basemap example?
In this case, we would save one image for something else. I remember that there is a limit for the number of images by G^3.

  • A topographic map [Already in the example]
  • A tilemap-style basemap [Already in the example]
  • Another map that uses one of the remote dataset (e.g., earth_day/earth_geoid) or a contour map?

Just tried the crustal age dataset, as this one is interesting for the area of Island.

Users unfamiliar with GMT can get a first impression of the types of basemaps PyGMT offers, while experienced GMT users can discover that PyGMT supports tilemap-style basemaps.

Please let me know that you think and I'd like to help if you don't have time to work on it.

I just added the other two maps for the region Island. Feel free to modify the codes, including choosing another area or dataset and re-ordering the maps.

@seisman
Copy link
Member

seisman commented Apr 24, 2025

@yvonnefroehlich What about extending this example to include more basemap types? Below are four basemaps that can fit in a 2x2 subplot layout.

  • A coastline-type basemap, with coastlines, and colored land/ocean

There is already an example for Figure.coast (PR #1, https://github.com/GenericMappingTools/pygmt-paper-figures/blob/main/basic-map.ipynb). Do we want to replace this separate example and include it in this basemap example? In this case, we would save one image for something else. I remember that there is a limit for the number of images by G^3.

I prefer to use the following figure generated by #4 as our Figure 2. It's similar to the one in PR #1, but for a global region.
image

Then in this example, a regional coastline-style base map makes more sense.

I just added the other two maps for the region Island. Feel free to modify the codes, including choosing another area or dataset and re-ordering the maps.

Thanks. My suggestions are:

@weiji14
Copy link
Member

weiji14 commented Apr 28, 2025

Do you want a proper satellite image (e.g. Sentinel-3 or MODIS), or just use Blue Marble @earth_day/load_blue_marble? The satellite image might require quite a few lines of code as I'll need to reproject from UTM to lon/lat (so the frame is consistent across all 4 subplots), but doable. Just depends on what you want to show in the paper.

@seisman seisman changed the title Figure XY: Backgroundmaps Figure 3: Backgroundmaps Jun 9, 2025
@seisman
Copy link
Member

seisman commented Oct 11, 2025

@yvonnefroehlich In panel (a) or (b), could you please add a scale bar or a directional rose, and also use the Box class adding a box around it. This will be an example demonstrating the Box class introduded in v0.17.0.

@seisman
Copy link
Member

seisman commented Oct 11, 2025

The satellite image might require quite a few lines of code as I'll need to reproject from UTM to lon/lat (so the frame is consistent across all 4 subplots)

Maybe just use UTM projection to demonstrate that GMT supports both lon/lat and UTM?

@seisman
Copy link
Member

seisman commented Oct 14, 2025

@yvonnefroehlich Here are my three suggestions:

  1. Since it's a figure to be included in a scientific paper, each subplot should be labeled. Please use Figure.subplot rather than Figure.shift_origin and add tags (e.g., (a)) to subplots.
  2. I see that you're using variables like
region = "IS"  # country code for Iceland ("IS")
args_base = {"region":region, "projection":"M12c"}
args_grid = {"resolution":"03m", "region":region}

I prefer to removing these variables to keep the script simpler and more readable.
3. Remove detailed explanations (i.e., comments) from the script. These explanations should be included in the manuscript if necessary.

@seisman
Copy link
Member

seisman commented Oct 17, 2025

It seems you accidently deleted all the codes in the notebook. Please add it back.

@yvonnefroehlich
Copy link
Member Author

It seems you accidently deleted all the codes in the notebook. Please add it back.

Oh, no - strange, do not know what I did 🙁. But the codes should be back in commit d3fa667.

@seisman
Copy link
Member

seisman commented Nov 5, 2025

@yvonnefroehlich In panel (a) or (b), could you please add a scale bar or a directional rose, and also use the Box class adding a box around it. This will be an example demonstrating the Box class introduded in v0.17.0.

@yvonnefroehlich When working on the manuscript, I feel this is not a good place to introduce the Box class mainly because this is the first example and already have a lot of concepts to explain. Could you please remove the box in this example and instead add a box in #10.

@yvonnefroehlich yvonnefroehlich changed the title Figure 3: Backgroundmaps Figure 3: Backgroundmaps - coast, remote dataset for Earth relief, tilemap, 3-D - Iceland Nov 21, 2025
@yvonnefroehlich yvonnefroehlich changed the title Figure 3: Backgroundmaps - coast, remote dataset for Earth relief, tilemap, 3-D - Iceland Figure 3: Backgroundmaps - coast, remote dataset, tilemap, 3-D - relief of Iceland Nov 21, 2025
yvonnefroehlich and others added 7 commits November 27, 2025 08:36
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
fig.colorbar(frame=["xa500f250+lElevation", "y+lm"], position="JRM", shading=True)

# Bottom right
fig.basemap(region=region, projection="M?", perspective=(-150, 25), panel=3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the Figure.basemap call here? Or merge it into Figure.grdview.

Actually I'm not sure if the use of region is correct here, since in a 3-D perspective view, region may need six values rather than four.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I testded this locally and for me it looks like that the output figure remains unchanged. I think this can get problematic for Figure.plot3d and six values need to be passed to the region parameter.
I like about using Figure.basemap and Figure.grdview that we can show that for the first method the users has to define the perspective parameter, but for the following methods perspective=True can be used.

@seisman
Copy link
Member

seisman commented Nov 27, 2025

I guess this PR is good to merge, right?

@yvonnefroehlich Could you please copy the Python script to Jupyter Notebook and remove the PNG and .py files?

@yvonnefroehlich
Copy link
Member Author

I guess this PR is good to merge, right?

@yvonnefroehlich Could you please copy the Python script to Jupyter Notebook and remove the PNG and .py files?

Yes, I think this figure looks good and we can move on with the remaining figure. Can still make PRs for details and making things consistent in the end.

@seisman
Copy link
Member

seisman commented Nov 27, 2025

Could you also please remove the PNG and clean the notebook output

@seisman
Copy link
Member

seisman commented Nov 29, 2025

Please also remove the execution permission from .ipynb.

@seisman
Copy link
Member

seisman commented Nov 29, 2025

Could you please also remove the image included in the Jupyter Notebook? We definitely will update the script and the image later, so keeping them in the notebooks will increase the repo size quickly. We will include them when the scripts are finalized.

@seisman seisman merged commit 4440791 into main Nov 29, 2025
1 check passed
@seisman seisman deleted the fig/backgroundmaps branch November 29, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants