matplotlib / matplotlib/matplotlib

Document idiosyncratic behavior of `transform` kwarg

Open
#12,551 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation keep
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

### Bug report

**Bug summary**

Passing `transform=None` through imshow results in a blank plot.

I've been playing around a little bit with data transforms and projections in matplotlib. For one of the things I've been testing out, I also want to see how my data looks if the transform isn't set by the user, so I passed in `transform=None` as a kwarg to imshow. This resulted in a blank plot. I'm not sure if this is a preferred outcome, but I personally would have expected a plot without a transform set, but the data showing.

**Code for reproduction**

```python
from numpy import random
import matplotlib.pyplot as plt

data = random.random((20,20))

fig, (ax1, ax2) = plt.subplots(2)

ax1.imshow(data)
ax2.imshow(data, transform=None)
plt.show()
```

**Outcome**
![image](https://user-images.githubusercontent.com/6745434/47117331-b0698e80-d229-11e8-9668-fef4acc5bf01.png)

**Matplotlib version**

* Operating system: OSX Sierra 10.12.6
* Matplotlib version: 2.2.2 and 3.0.0
* Matplotlib backend (`print(matplotlib.get_backend())`): MacOSX
* Python version: 3.6.5 and 3.6.6

I tried testing this script out in two different conda environments that I have on my machine with the same result. Both envs I tested this script out on use matplotlib pulled from conda-forge. One environment has v2.2.2 and the other has v3.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided imshow reproduction and reading the imshow entry point and its transform handling. Determine the intended behavior for transform=None, then document that behavior and its consequences in the relevant Matplotlib documentation; done means the documented behavior matches the confirmed result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.