Skip to content

Error about xticklabel in geoaxes #148

Closed
@heylsitan

Description

@heylsitan

Description

I use labels=True in ax.format, although i set lonlim=(120,260), it return all the ticks along x axis.

Steps to reproduce

f,axs=plot.subplots(axwidth=10,proj='cyl',proj_kw={'lon_0': 180})
ax=axs[0]


for i in range(lon2.shape[1]):
    longitude=lon2[:,i]
    latitude=lat2[:,i]
    h=p2[1:,i]
    
    points = np.array([longitude, latitude]).T.reshape(-1, 1, 2)
    segments = np.concatenate([points[:-1], points[1:]], axis=1)

    norm = plt.Normalize(100, 800)

    lc = LineCollection(segments, cmap=cmaps.MPL_jet, norm=norm,transform=ccrs.PlateCarree())        
    lc.set_array(h)

    line = ax.add_collection(lc)    

tick=[-0.5,0.5]
m=ax.contour(flag,levels=tick,color='red',zorder=20)

ax.scatter(LHx2,LHy2,marker='x')

ax.format(title='1979-01-04:00',fontsize=15, land=True, landcolor='gray',latlim=(15,80),lonlim=(120,260),labels=True)
ax.colorbar(line,loc='bottom',label='unit(hPa)')

error

Expected behavior: [What you expected to happen]
only show the xticklabels in the lonlim.
Actual behavior: [What actually happened]
show the ticklabels outside of the lonlim

Equivalent steps in matplotlib

Please make sure this bug is related to a specific proplot feature. If you're not sure, try to replicate it with the native matplotlib API. Matplotlib bugs belong on the matplotlib github page.

# your code here, if applicable

Proplot version

0.50
Paste the result of import proplot; print(proplot.version) here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions