Skip to content

Commit ccb09f1

Browse files
authored
Merge pull request #1971 from mccode-dev/farhi-mcplot-log10-ymin-0
Update plotfuncs.py: fix log scale when min(data) ~ 0
2 parents ee7c031 + 14f548a commit ccb09f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/Python/mcplot/pyqtgraph/plotfuncs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def plot_Data2D(data, plt, log=False, legend=True, icolormap=0, verbose=False, f
197197
idx = dataset[dataset>0]
198198
if len(idx) > 0:
199199
ymin = np.min(idx)/10
200+
if ymin <= 0:
201+
ymin=100*sys.float_info.min # Small, finite value.
200202
dataset[dataset<=0] = ymin
201203
dataset = np.reshape(dataset, datashape)
202204
dataset = np.log10(dataset)

0 commit comments

Comments
 (0)