matplotlib / matplotlib/matplotlib
inverse transform break chaining
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 23.2k
- フォーク
- 8.5k
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 66
説明
### Bug report
**Bug summary**
Transform chaining seems to not be possible in some cases. As an example
```
tr = ax.transAxes - ax.transData + ax.transData
```
gives a different result than
```
tr = ax.transAxes
```
although those are linear transformations, which can easily be inverted, so one would expect
```
A + B^-1 + B == A
```
The following example shows that this is not the case.
**Code for reproduction**
The code should create a red and a green line from [0,0] to [1,1] in axes cooridinates. Yet the red line is somehow fixed to its initial prosition and forgets about its transform.
```
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
# apply transform A + B^-1 + B
# this should equal A
tr = ax.transAxes - ax.transData
trinv = ax.transData
line = plt.Line2D([0,1],[0,1],transform=tr+trinv, color="crimson")
ax.add_line(line)
# apply transform A
line2 = plt.Line2D([0,1],[0,1],transform=ax.transAxes, color="limegreen")
ax.add_line(line2)
ax.set_ylim(.1,1.1)
plt.show()
```
**Actual outcome**

**Expected outcome**
A plot with red and green line overlapping.
Now it may well be that I'm completely misunderstanding the transform chaining in which case it would probably be good to update the documentation.
**Matplotlib version**
* Operating system: Windows 8.1
* Matplotlib version: 2.2
* Matplotlib backend: Qt4Agg as well as TkAgg
* Python version: 2.7.10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供されている Python の再現コードを ax.transAxes、ax.transData、Line2D で実行し、次に A + B^-1 + B に関係する変換の連鎖の挙動を調べます。ax.set_ylim(.1, 1.1) の後で赤い線と緑の線を比較します。連鎖した変換が ax.transAxes と一致するか、変換のドキュメントで期待される挙動が明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100