Skip to content

(Incomplete) inline code examples of pygmt.Figure class #2084

Description

@yvonnefroehlich

Maybe the inline code examples for the pygmt.Figure class are incomplete:

fig = Figure()
fig.basemap(region=[0, 360, -90, 90], projection="W7i", frame=True)
fig.savefig("my-figure.png")
# Make sure the figure file is generated and clean it up
import os
os.path.exists("my-figure.png")
os.remove("my-figure.png")
fig = Figure()
fig.basemap(region="JP", projection="M3i", frame=True)
# The fig.region attribute shows the WESN bounding box for the figure
print(", ".join(f"{i:.2f}" for i in fig.region))

From my understanding, these examples should be directly executable. In case this is correct, I feel these two examples can be improved:

from pygmt import Figure
fig = Figure()

# OR

import pygmt
fig = pygmt.Figure()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions