isl-org / isl-org/Open3D

plt.tick_params() influences rounding of read pointcloud

Open
#5,706 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Describe the issue

When I use `plt.tick_params()` before loading a pointcloud with open3d, the read pointcloud gets rounded to whole integer values.

Matplotlib github issue: https://github.com/matplotlib/matplotlib/issues/24497

stackoverflow question on this: https://stackoverflow.com/questions/74467675/rounding-of-read-pointcloud-when-using-matplotlibs-tick-params

Where the file `pointcloud.pcd` is:
```
# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z rgb
SIZE 4 4 4 4
TYPE F F F F
COUNT 1 1 1 1
WIDTH 1238796
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 1
DATA ascii
829.88127 1899.80715 101.29749 7.560041649e-39
```

### Steps to reproduce the bug

```python
import matplotlib.pyplot as plt
import numpy as np
import open3d as o3d

# X | line of code in question
plt.tick_params(axis='both', labelsize=1)

# read pointcloud
pcd = o3d.io.read_point_cloud("pointcloud.pcd")
points = np.asarray(pcd.points)
print(points)
```

### Error message

Actual outcome:

[[ 829. 1899. 101.]]

### Expected behavior

I expect to see non-rounded values:

[[ 829.88127 1899.80715 101.29749]]

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 20.04
- Python version: Python 3.9.15
- Open3D version: 0.15.2
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```

### Additional information

- Numpy version: 1.22.3
- Matplotlib version: 3.5.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.