-
Notifications
You must be signed in to change notification settings - Fork 244
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Using the pygmt.Figure.subplot method the x and y axis labels set via the sharex and sharey parameters do not always show up.
First mentioned by @weiji14 in #2354 (review):
Been trying to set a subtitle using sharex="b+lNormalize" and sharey="l+lAzimuth" but it doesn't show up. Wondering if the +l is broken, or if there's some setting overriding the label...
Original post by @yvonnefroehlich at #2354 (comment):
There seems to be a difference between using with fig.set_panel(panel=index): and panel=True, which is probably not intended.
(1) with fig.set_panel(panel=index): -> Does NOT add x and y labels
Example code:
import pygmt
nrows = 1
ncols = 2
fig = pygmt.Figure()
with fig.subplot(
nrows=nrows,
ncols=ncols,
figsize=("10c", "5c"),
sharex="b+llabel_x",
sharey="l+llabel_y",
):
for i in range(nrows):
for j in range(ncols):
index = i * nrows + j
# does NOT add x and y labels
with fig.set_panel(panel=index):
fig.basemap(region=[0, 10, 0, 10], projection="X?")
fig.show()
# fig.savefig(fname="issue_labels_doubleloop.png")(2) panel=True -> DOES add x and y labels
Example code:
import pygmt
nrows = 1
ncols = 2
fig = pygmt.Figure()
with fig.subplot(
nrows=nrows,
ncols=ncols,
figsize=("10c", "5c"),
sharex="b+llabel_x",
sharey="l+llabel_y",
):
for i in range(nrows):
for j in range(ncols):
# DOES add x and y labels
fig.basemap(region=[0, 10, 0, 10], projection="X?", panel=True)
fig.show()
# fig.savefig(fname="issue_labels_panelTrue.png")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

