- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个 900k+ 行和 28 列的数据框。我正在使用我在 at this example 中找到的代码片段在 plotly 官网:
import plotly.plotly as py
import pandas as pd
scatter = dict(
mode = "markers",
name = "y",
type = "scatter3d",
x = col1, y = col2, z = col3,
marker = dict( size=2, color="rgb(23, 190, 207)" )
)
clusters = dict(
alphahull = 7,
name = "y",
opacity = 0.1,
type = "mesh3d",
x = col1, y = col2, z = col3
)
layout = dict(
title = '3d point clustering',
scene = dict(
xaxis = dict( zeroline=False ),
yaxis = dict( zeroline=False ),
zaxis = dict( zeroline=False ),
)
)
fig = dict( data=[scatter, clusters], layout=layout )
# Use py.iplot() for IPython notebook
py.plot(fig, filename='3d point clustering')
我的 df 已经加载了。请注意,col2
具有 'object'
数据类型。
我在 jupyter notebook 中运行它。当我运行这段代码时,一切似乎都很顺利,但我却出现了这个警告:
UserWarning:
Woah there! Look at all those points! Due to browser limitations, the Plotly SVG drawing functions have a hard time graphing more than 500k data points for line charts, or 40k points for other types of charts. Here are some suggestions:
(1) Use the `plotly.graph_objs.Scattergl` trace object to generate a WebGl graph.
(2) Trying using the image API to return an image instead of a graph URL
(3) Use matplotlib
(4) See if you can create your visualization with fewer data points
If the visualization you're using aggregates points (e.g., box plot, histogram, etc.) you can disregard this warning.
此警告连续出现 7 次。看起来必须有一些限制才能在基于 Web 浏览器的 UI(如 jupyter 笔记本)中绘制此图。
我试图导入模块“plotly.graph_objs.Scattergl”,但它说在 pyplot 中没有这样的模块。
我只是不知道如何解决此限制。如果无法做到这一点,我如何使用 matplotlib
制作类似的图?任何帮助将不胜感激。
非常感谢
最佳答案
也许你错误地调用了Scattergl
...检查here .
我认为这就是您要查找的内容(示例取自文档):
import plotly.graph_objs as go
trace = go.Scattergl(...)
希望对你有帮助
关于python - Plotly - 在 plotly 上绘制 k-means 集群是行不通的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53073256/
我正在尝试实现这个简单的幻灯片:http://codepen.io/rafaelcastrocouto/pen/doZNMo 但我没有成功,我不知道问题是什么,唯一显示的是幻灯片的最后一张图片,我添加
我对 Promise 还很陌生,我认为我没有正确理解它,因为我在代码中尝试它但没有成功。 我在 NodeJS 上有一个服务器,使用 Express 库和 express-promise var exp
为什么两个盒子都在右边,而不是居中对齐? fiddle :http://jsfiddle.net/gh76q/1/ 我尝试将方框 2 的位置更改为相对位置,它可以解决问题,但当鼠标悬停在方框 1 上时
这个问题在这里已经有了答案: scanf() leaves the newline character in the buffer (7 个答案) 关闭 4 年前。 如果我尝试这样的事情: int
这个问题在这里已经有了答案: scanf() leaves the newline character in the buffer (7 个答案) 关闭 4 年前。 如果我尝试这样的事情: int
我有一张我的小 table ,它似乎不起作用。 CSS 会告诉所有我想要的高度和宽度。我这样做的方式有误吗?或者我错过了什么? 为什么不是所有的边界都对齐? 表格、html 和 CSS 可以在这个 j
我正在尝试使用localStorage制作一个简单的程序。我创建了一个按钮来重置 localStorage 中的所有数据。不幸的是,它不起作用,我不知道为什么。 这是我的代码: var sl
我有一个 Div,我想做的是,当您将鼠标悬停在 div 1 上时,它会更改 div 2。 所以我可以通过 .div1:hover .div2 的 CSS 来做到这一点,这意味着当我将鼠标悬停在 1 上
出于某种原因,比较逻辑无法正常工作……它不会比较两个 NSDecimalNumber 对象。有时有效,有时无效。真的很奇怪。 if 语句适用于某些编译,有时则不然。这是正确的做法吗? 数据来自一个 j
我在 iOS 上使用 Phonegap 2.1.0。在我的 main.html 文件中,我使用 jQuery 加载了一些 html。 但是,我正在加载的其中一个 html 文件有自己的 Javascr
行不通,而嵌套
我一般不会嵌套像这样: The following: one two 我将使用 像那样嵌套反而。但是今天我用了但似乎 Emacs 和 Google Chrome 都会考虑外部 一看
我有 3 个框 (div-s)。 main-box里面有两个盒子。第一个 (Box1) 向右浮动,另一个 (Box2) 向左浮动。 两个框的高度都设置为 100%,所以当其中一个拉伸(stretch)
我是一名优秀的程序员,十分优秀!