- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
一直在使用holoview来生成一些整洁的图。我想看看我对 hv.Curve
之类的东西有什么选择,当我使用 opts 时。几乎没有文档。 help page for holoview没有帮助。其中说“对于完整的文档以及可用的样式和绘图选项,请使用 hv.help(hv.Curve)
。”然而,它没有解释如何使用它。我试过将它作为代码的一部分运行。我试过在我的终端中运行命令。我试过 print()
,并运行 help()
.我只想知道我可以在这里放什么:overlay.opts(legend_position='right')
此外legend_position
?这是我试图获取 hv.help(hv.Curve)
的代码命令工作。我知道这很可笑:
#!/usr/bin/env python3
import holoviews as hv
import numpy as np
import scipy.special
import pandas as pd
import bokeh
import pandas as pd
import numpy as np
import bokeh as bk
import plotly.graph_objects as go
import plotly.express as pex
import holoviews.plotting.bokeh
import numpy as np
import pandas as pd
from holoviews import *
from holoviews import Store
from bokeh.plotting import show
from holoviews import opts
from holoviews import Store
from holoviews import dim, opts
hv.help(hv.Curve)
这是我收到的错误消息:
backend_registry = cls.store.registry.get(backend, {})
AttributeError: 'NoneType' object has no attribute 'registry'
感谢您的帮助,如果我能提供更多信息,请告诉我,因为这是我在本网站上的第一篇文章。
最佳答案
这里涉及到几个问题。首先,HoloViews 中的选项取决于您选择的绘图库后端,例如散景、matplotlib 或 plotly。在您的代码 list 中,您尚未加载绘图库后端,因此您将无法获得有关绘图选项(如 legend_position
)的任何帮助。 .当然,您不应该收到像您看到的 AttributeError 这样的错误消息,因此请在 https://github.com/holoviz/holoviews/issues 提交问题。如果你能帮助我们复制那个虚假信息。我在运行 hv.help(hv.Curve)
时没有看到任何错误消息没有加载绘图后端;相反,我得到了 Sander 报告的内容,这是与绘图无关的选项的简短列表,无论后端如何,都应该始终可用:
$ python
>>> import holoviews as hv
>>> hv.help(hv.Curve)
Parameters of 'Curve'
=====================
Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None
Name Value Type Bounds Mode
cdims OrderedDict() Dict V RW
datatype ['dataframe', 'dictionary', 'grid', '... List (0, None) V RW
extents (None, None, None, None) Tuple V RW
group 'Curve' String C RW
kdims [Dimension('x')] List (1, 2) V RW
label '' String C RW
vdims [Dimension('y')] List (1, None) V RW
Parameter docstrings:
=====================
cdims: The constant dimensions defined as a dictionary of Dimension:value
pairs providing additional dimension information about the object.
...
vdims: The value dimensions of the Chart, usually corresponding to a
number of dependent variables.
如您所见,在这种情况下,这 7 个选项都没有帮助。如果您加载绘图后端,您将获得更多选项:
>>> hv.extension("bokeh")
>>> hv.help(hv.Curve)
Curve
Online example: http://holoviews.org/reference/elements/bokeh/Curve.html
-------------
Style Options
-------------
alpha, color, hover_alpha, hover_color, hover_line_alpha, hover_line_color, line_alpha, line_cap, line_color, line_dash, line_join, line_width, muted, muted_alpha, muted_color, muted_line_alpha, muted_line_color, nonselection_alpha, nonselection_color, nonselection_line_alpha, nonselection_line_color, selection_alpha, selection_color, selection_line_alpha, selection_line_color, visible
(Consult bokeh's documentation for more information.)
------------
Plot Options
------------
The plot options are the parameters of the plotting class:
Parameters of 'CurvePlot'
=========================
Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None
Name Value Type Bounds Mode
active_tools [] List (0, None) V RW
... 57 other options...
zlim (nan, nan) Tuple V RW
Parameter docstrings:
=====================
active_tools: Allows specifying which tools are active by default. Note
that only one tool per gesture type can be active, e.g.
both 'pan' and 'box_zoom' are drag tools, so if both are
listed only the last one will be active.
... 57 other options...
zlim: User-specified z-axis range limits for the plot, as a tuple (low,high).
If specified, takes precedence over data and dimension ranges.
这里的“样式”选项只列出,没有记录,因为它们是直接传递给底层绘图库的,因此不能在这里记录;在这种情况下,请参阅散景。其他选项有文档字符串,因为它们是由 HoloViews 实现的。
legend_position
实际上不在任何一个列表中。那是因为
legend_position
是不属于
hv.Curve
的选项但来自
hv.Overlay
,用于可覆盖事物(曲线和许多其他对象)的通用容器。所以你需要做
hv.help
在 Overlay 类上:
>>> hv.help(hv.Overlay)
Overlay
Online example: http://holoviews.org/reference/containers/bokeh/Overlay.html
-------------
Style Options
-------------
background_fill_alpha, background_fill_color, border_alpha, border_color, border_hover_alpha, border_hover_color, border_hover_line_alpha, border_hover_line_color, border_line_alpha, border_line_cap, border_line_color, border_line_dash, border_line_join, border_line_width, border_muted_alpha, border_muted_color, border_muted_line_alpha, border_muted_line_color, border_nonselection_alpha, border_nonselection_color, border_nonselection_line_alpha, border_nonselection_line_color, border_selection_alpha, border_selection_color, border_selection_line_alpha, border_selection_line_color, click_policy, glyph_height, glyph_width, label_height, label_standoff, label_width, legend_padding, legend_spacing, text_align, text_alpha, text_baseline, text_color, text_font, text_font_size, text_font_style
(Consult bokeh's documentation for more information.)
------------
Plot Options
------------
The plot options are the parameters of the plotting class:
Parameters of 'OverlayPlot'
===========================
Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None
Name Value Type Bounds Mode
active_tools [] List (0, None) V RW
...66 more options...
zlim (nan, nan) Tuple V RW
Parameter docstrings:
=====================
active_tools: Allows specifying which tools are active by default.
...
legend_position: Allows selecting between a number of predefined legend position
options. The predefined options may be customized in the
legend_specs class attribute.
...
所以你可以看到
legend_position
是一种选择,但毕竟,它仍然没有告诉你什么是允许的。令人沮丧!在许多情况下,您可以在 Jupyter 中键入它的一部分并调用制表符补全,但在这种情况下,使用字符串参数,最好的办法就是提供不正确的值。如果你在 Jupyter 中这样做,你会得到一个允许选项的列表:
>>> hv.Overlay().opts(hv.opts.Overlay(legend_position='aslkjf'))
ValueError: aslkjf not in Parameter legend_position's list of possible objects, valid options include [top_right, top_left, bottom_left, bottom_right, right, left, top, bottom]
信息很多,但很难找到!
关于python - 如何在 Python 中使用 Bokeh 查看 Holoviews 的选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65191364/
我有一个用 Swift 编写的自定义转换,当呈现的 View 从侧面进入时,被关闭的 View 消失。 现在我想要同样的效果,但我希望呈现的 View 从顶部进入,而被取消的 View 从底部出来。
该方法的预期目的是什么 findBinding(View view) ? 我一直在使用数据绑定(bind)库测试版。 目前还没有针对各个类的官方引用文档,所以我一直在查看源代码以了解我们可以访问哪些方
我试图在遍历 &str 时查看当前位置前面的字符。 let myStr = "12345"; let mut iter = myStr.chars().peekable(); for c in ite
每当我在 Azure 中创建新的 Azure 函数应用时,我都会选择一个存储帐户供其使用。 创建应用后,如何查看/更改存储帐户? 我尝试在门户中浏览,但无法看到可以在哪里配置它。 最佳答案 创建后,您
我想查看读取 QFile 的 QTextStream 的下一个字符,以创建一个高效的标记器。 但是,我没有找到任何令人满意的解决方案。 QFile f("test.txt"); f.open(QIOD
当我旋转手机时, ListView 中选定的项目将被取消选择。这是我的适配器。我只想更改所选项目的颜色(仅是单个选择),当我旋转手机时,我想查看我选择的内容。现在,当我旋转手机时,我看不到所选项目。
我开始编写代码来检查函数的返回值,但我不确定在捕获到一些错误后如何继续。 例如,在 fgets 中: while( fgets( rta, 3, stdin ) == NULL ) {
是否可以获取或创建一个 optional 轮,它以假想的圆圈滚动而不是直接向下(垂直)滚动? 直线链接但想要弯曲 例如就像控件 here ,但车轮是弯曲的? 最佳答案 有没有可能你想要的是一个轮播?
当我尝试为其创建 View 时出现错误:“ View 的 SELECT 在 FROM 子句中包含一个子查询”,但它在普通查询中工作正常。我认为它与我的 WHERE 子句有关,但我不明白为什么或如何修复
在一个类中,我有以下代码: /// [System.Xml.Serialization.XmlElementAttribute("Errors", typeof(ErrorsType))] [Sys
我想显示来自 catch block 的错误(日志)消息。如何在单个屏幕上显示所有消息(堆栈),以便用户了解? 谢谢... 最佳答案 使用 Toast 怎么样? 示例: Toast.makeText(
我有以下屏幕(图像),当按下按钮时显示一个侧面菜单,菜单出现,另外我有一个 uitableview 来显示其他东西 我的问题是,当侧边菜单出现时,uitableview 被调整了大小。 如何保持 ui
invariant violation element type is invalid: expected a string (for built-in components) or a class/
我是新手,正在尝试学习 fork() 和系统调用的功能,现在我正在使用 execvp() 来尝试制作 bash,但我遇到的问题是,当我编写正确的命令时,程序结束,我想循环使用我的 bash,直到有人在
我正在尝试使用 Laravel request validation method 创建一个登录页面 和凭据验证 -> 如果用户未通过身份验证,它将返回错误“密码错误....” 我在两种不同的情况下看
我有一个 .jar 文件,我需要查看 jar 文件的内容。 是否有任何解码器可用于解码 jar 文件。 我也有 solaris 环境,我需要知道什么是 最佳答案 使用jar命令行,即 jar tf j
Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 每个人 每天的提
问题 tensor详细数值 不能直接print打印: ? 1
一,uptime 可以查看系统的运行时间 show global status like 'uptime'; 二,利用linux命令查看 Linux 下有个 uptime 可以查看系统的运行时
在所有主流的浏览器中,均能够查看原始的 XML 文件 不要指望 XML 文件会直接显示为 HTML 页面 查看 XML 文件 <?xml version="1.0" e
我是一名优秀的程序员,十分优秀!