☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Disable point adding and moving in PointDrawTool

Community Supportbokeh
ichxw
ichxw

The reason I want to disable point adding and moving functions is that I don’t need to add or move any of them. After showing dozens of points, I want to check the reliability of those points based on some experiences. Then select and delete those outliers. But sometimes points will be accidentally added or moved by wrong clicking.
If they can’t be disabled, are there any new ways to use?

⌁   Link to post
_jm
_jm

Hi @ichxw

Set the add and drag arguments to the PointDrawTool() constructor to False.

The arguments are documented in the bokeh reference document; see the PointDrawTool class section. The relevant properties are not listed in the user’s documentConfiguring Plot Tools section.

Here’s a simple illustrative example.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import numpy as np

from bokeh.models import ColumnDataSource
from bokeh.models.tools import PointDrawTool

from bokeh.plotting import figure

from bokeh.io import show

data = dict(x=np.random.randn(12), y=np.random.randn(12))
source = ColumnDataSource(data)

p = figure(width=500, height=500)
r = p.circle(x='x', y='y', source=source, size=30)

_tool = PointDrawTool(renderers=[r], add=False, drag=False)
p.add_tools(_tool)
p.toolbar.active_tap = _tool

show(p)
⌁   Link to post
Bryan
Bryan

The UndoTool does not know anything about the actions that the edit tools perform. Maintaining a history of data changes would be, in general, prohibitively expensive to do.

⌁   Link to post

End of archived discussion · Replies are disabled