Skip to content

Commit 1505476

Browse files
authored
Update datashader.md
1 parent f2e26e8 commit 1505476

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/python/datashader.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ df = pd.read_parquet('https://raw.githubusercontent.com/plotly/datasets/master/2
105105

106106
cvs = ds.Canvas(plot_width=100, plot_height=100)
107107
agg = cvs.points(df, 'SCHEDULED_DEPARTURE', 'DEPARTURE_DELAY')
108-
agg.values = np.log10(agg.values)
108+
zero_mask = agg.values == 0
109+
agg.values = np.log10(agg.values, where=np.logical_not(zero_mask))
110+
agg.values[zero_mask] = np.nan
109111
fig = px.imshow(agg, origin='lower', labels={'color':'Log10(count)'})
110112
fig.update_traces(hoverongaps=False)
111113
fig.update_layout(coloraxis_colorbar=dict(title='Count', tickprefix='1.e'))

0 commit comments

Comments
 (0)