matplotlib / matplotlib/basemap

plotparallels()/plotmeridians() only support xoffset or yoffset not both and do not support horizontalalignment or verticalalignment

未关闭
#325 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
817
派生
395
PR 合并指标
30 天内没有已合并 PR

描述

plotparallels() and plotmeridians() only support xoffset or yoffset not both.

plotparallels() and plotmeridians() do not support horizontalalignment or verticalalignment via kwargs as these are hard coded within Basemap.

I found both of these because I wanted the labels inside the map border with the parallels above the line at the right of the plot and the meridians to the right of the line at the bottom of the plot. I found a hack by altering the returned matplotlib objects:

meridians = bmap.drawmeridians(meridians,labels=[0,0,1,0],fontsize=10,
                               color='gray', yoffset=-abs(right-left)
for k, v in meridians.iteritems():
    v[1][0].set_horizontalalignment('left')

This sets the label to the top but then moving them the size of the plot then setting horizontal alignment via returned matplotlib object.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

定位 plotparallels() 和 plotmeridians() 的实现,并追踪 xoffset、yoffset 和 kwargs 的处理方式。验证地图两侧都有标签时的行为:两个偏移量应能同时生效,并且应接受 horizontalalignment 和 verticalalignment。完成的标准是,调用方不再需要修改返回的 matplotlib 对象来实现这种定位。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。