散景图无法正确显示 [英] Bokeh plot not displaying correctly
问题描述
我在几个Django视图中使用Bokeh图.这些图可以正确呈现数据,但是在我的页面上呈现时它们会怪异地歪斜.
I am using Bokeh plots in a couple of my Django views. The plots are rendering the data correctly, but they are weirdly skewed when rendered on my page.
html看起来像这样:
The html looks like this:
<div class="container">
<h4 class="text-center"> Resource Usage </h4>
{% for label,div in divs.items %}
<h3 class="text-center"><u> Satellite {{ label }}</u></h3>
</br>
<div class="container">
{{ div | safe }}
</div>
{% endfor %}
</div>
</div>
{{ script | safe }}
div
代码如下所示:
'<div class="plotdiv" id="b367d397-25cc-4fa2-9b92-e0d0a8f155fa"></div>'
我只是在尝试Bokeh的基本示例此处但是得到的东西看起来像这样:
I'm just trying Bokeh's base example here but am getting something that looks like this:
有人能告诉我为什么会发生这种偏移吗?
Can anyone tell me why that offset is happening?
推荐答案
在对Bokeh的Google小组进行讨论之后,问题是我将CSS样式应用于页面中其他位置的表,这影响了Bokeh的绘制方式正在显示.删除表格样式后,可以正确显示绘图.
After a discussion on Bokeh's Google group, the problem was that I applied CSS styling to tables that I have elsewhere in my page and that was affecting how the Bokeh plots were being displayed. Once I removed the table styling the plots displayed correctly.
这篇关于散景图无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!