I like the default "sticky" behavior of the x bounds in line and area plots but have found that I can't override that behavior with xmargin when I want to.
Steps to reproduce
import proplot as pplt
x = pplt.arange(0,1,0.1)
z = pplt.arange(1,2,0.1)
fig, ax = pplt.subplots(aspect=(2,1))
ax.plot(x,3**(z),c='blurple')
ax.plot(x,6**(z),c='yellow6')
ax.area(x,2**(z),4**(z),color='blurple',alpha=0.2,lw=0)
ax.area(x,5**(z),7**(z),color='yellow6',alpha=0.2,lw=0)
ax.format(xmargin=0.2, xlocator=0.2) #xmargin has no effect here
Expected behavior:
Setting xmargin=0.2 should expand my x axis range to −0.2 to 1.2. However, setting xmargin has no effect. Since "sticky" bounds are not enforced for scatter plots, the desired xmargin can be shown with ax.scatter.
fig, ax = pplt.subplots(aspect=(2,1))
ax.scatter(x,3**(z),c='blurple',s=15)
ax.scatter(x,6**(z),c='yellow6',s=15)
ax.format(xmargin=0.2, xlocator=0.2) #This produces the desired x axis range
Description
I like the default "sticky" behavior of the x bounds in line and area plots but have found that I can't override that behavior with
xmargin
when I want to.Steps to reproduce
Expected behavior:
Setting
xmargin=0.2
should expand my x axis range to −0.2 to 1.2. However, settingxmargin
has no effect. Since "sticky" bounds are not enforced for scatter plots, the desiredxmargin
can be shown withax.scatter
.Actual behavior:
See first example.
Proplot version
proplot=0.9.5.post284 matplotlib=3.4.3