enthought / enthought/chaco

Constant plot with positive power of 10

Open
#183 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
305
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Computing the ticks for a constant 1d plot fails, if the y-value is a positive power of 10. The problematic code is in chaco/data_range_1d.py in line 471ff:

```
# Round up to the next power of ten that encloses these
log_val = log(abs(real_min), 10)
if real_min >= 0:
real_min = pow(10, floor(log_val))
real_max = pow(10, ceil(log_val))
else:
real_min = -pow(10, ceil(log_val))
real_max = -pow(10, floor(log_val))
```

If real_min is a positive power of 10, then floor(log_val) and ceil(log_val) are identical and this leads to an issue in displaying the ticks. There it is assumed that real_min and real_max are different.

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.