Skip to content
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

Make the plotting API object oriented #31

Merged
merged 8 commits into from
Aug 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update notebook with the Figure class
  • Loading branch information
leouieda committed Aug 1, 2017
commit 6ed501393e9cf18148eca19e3f7eeb876982d0c0
41 changes: 21 additions & 20 deletions doc/first-steps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"outputs": [],
"source": [
"# Start a new figure. \n",
"gmt.figure()\n",
"fig = gmt.Figure()\n",
"# Create a Mercator map that is 6 inches wide\n",
"gmt.pscoast(R='-90/-70/0/20', J='M6i', G='chocolate', \n",
" S='skyblue', P=True, B='afg')"
"fig.pscoast(R='-90/-70/0/20', J='M6i', G='chocolate', \n",
" S='skyblue', B='afg')"
]
},
{
Expand All @@ -68,7 +68,7 @@
"metadata": {},
"outputs": [],
"source": [
"gmt.show()"
"fig.show()"
]
},
{
Expand All @@ -83,12 +83,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"help(gmt.pscoast)"
"help(fig.pscoast)"
]
},
{
Expand All @@ -107,11 +105,12 @@
"outputs": [],
"source": [
"# Calling figure again creates a new figure\n",
"gmt.figure()\n",
"gmt.pscoast(region=[-90, -70, 0, 20], projection='M6i', \n",
" land='chocolate', water='skyblue', \n",
" portrait=True, frame='afg')\n",
"gmt.show()"
"fig_alias = gmt.Figure()\n",
"fig_alias.pscoast(\n",
" region=[-90, -70, 0, 20], projection='M6i', \n",
" land='chocolate', water='skyblue', \n",
" frame='afg')\n",
"fig_alias.show()"
]
},
{
Expand All @@ -131,13 +130,15 @@
"metadata": {},
"outputs": [],
"source": [
"gmt.figure()\n",
"gmt.pscoast(region=[130, 150, 35, 50], projection='M6i', \n",
" frame='afg', shorelines=True,\n",
" land='gray', water='lightblue',)\n",
"gmt.psxy(data='@tut_quakes.ngdc', style='c0.3c', \n",
" color='blue', pen='faint', i='4,3')\n",
"gmt.show()"
"fig_quakes = gmt.Figure()\n",
"fig_quakes.pscoast(\n",
" region=[130, 150, 35, 50], projection='M6i', \n",
" frame='afg', shorelines=True, land='gray', \n",
" water='lightblue')\n",
"fig_quakes.psxy(\n",
" data='@tut_quakes.ngdc', style='c0.3c', color='blue', \n",
" pen='faint', i='4,3')\n",
"fig_quakes.show()"
]
},
{
Expand Down