Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Hvplot:如何删除默认工具_Python_Holoviews_Hvplot - Fatal编程技术网

Python Hvplot:如何删除默认工具

Python Hvplot:如何删除默认工具,python,holoviews,hvplot,Python,Holoviews,Hvplot,我正在使用HvPlot,它工作得很好,但我不知道如何删除默认工具“平移”、“滚轮缩放”和“框缩放”。 我的HvPlot代码是: points = df.hvplot.line(x='x', y='y', grid=True, tools=['xpan', # move along x 'xwheel_pan', #

我正在使用HvPlot,它工作得很好,但我不知道如何删除默认工具“平移”、“滚轮缩放”和“框缩放”。 我的HvPlot代码是:

points = df.hvplot.line(x='x', y='y',
                        grid=True,
                        tools=['xpan',          # move along x
                               'xwheel_pan',    # move along x with wheel
                               'xwheel_zoom',   # zoom on x with wheel
                               'xzoom_in',      # zoom in on x
                               'xzoom_out',     # zoom out on x
                               'crosshair',     # show where the mouse is on axis
                               'xbox_zoom',     # zoom on selection along x
                               'undo',          # undo action
                               'redo'],         # redo action
                        width=1200, height=550,
                        aggregator='any',
                        datashade=True)
我有这个数字:

您可以使用
.opts(默认工具=[])
来摆脱默认工具:

示例代码:

import numpy as np
import pandas as pd

import hvplot.pandas

df = pd.DataFrame({
    'x': np.random.normal(size=50),
    'y': np.random.normal(size=50),
})

scatter_plot = df.hvplot.scatter(
    x='x', y='y', 
    tools=['tap','box_select'])

# manually specifying the default tools gets rid of any preset default tools
# you also just use an empty list here
scatter_plot.opts(default_tools=['wheel_zoom'])
另请参见此问题+答案:

仅使用指定工具和默认工具生成的绘图:

import numpy as np
import pandas as pd

import hvplot.pandas

df = pd.DataFrame({
    'x': np.random.normal(size=50),
    'y': np.random.normal(size=50),
})

scatter_plot = df.hvplot.scatter(
    x='x', y='y', 
    tools=['tap','box_select'])

# manually specifying the default tools gets rid of any preset default tools
# you also just use an empty list here
scatter_plot.opts(default_tools=['wheel_zoom'])

您可以使用
.opts(默认工具=[])
来摆脱默认工具:

示例代码:

import numpy as np
import pandas as pd

import hvplot.pandas

df = pd.DataFrame({
    'x': np.random.normal(size=50),
    'y': np.random.normal(size=50),
})

scatter_plot = df.hvplot.scatter(
    x='x', y='y', 
    tools=['tap','box_select'])

# manually specifying the default tools gets rid of any preset default tools
# you also just use an empty list here
scatter_plot.opts(default_tools=['wheel_zoom'])
另请参见此问题+答案:

仅使用指定工具和默认工具生成的绘图:

import numpy as np
import pandas as pd

import hvplot.pandas

df = pd.DataFrame({
    'x': np.random.normal(size=50),
    'y': np.random.normal(size=50),
})

scatter_plot = df.hvplot.scatter(
    x='x', y='y', 
    tools=['tap','box_select'])

# manually specifying the default tools gets rid of any preset default tools
# you also just use an empty list here
scatter_plot.opts(default_tools=['wheel_zoom'])