我不确定如何在Python Jupyter笔记本中旋转图形,它对我来说是静态的,不会在鼠标移动时旋转
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x =[1,2,3,4,5,6,7,8,9,10]
y =[5,6,2,3,13,4,1,2,4,8]
z =[2,3,3,3,5,7,9,11,9,10]
ax.scatter(x, y, z, c=
我正在使用python和matplotlib,我正在尝试在Google Colab中创建一个交互式的绘图。我可以生成图,但它是静态的。我当前的代码如下:
%matplotlib notebook
%config InlineBackend.figure_format = 'retina'
from __future__ import print_function, division
import sys
import numpy as np
import astropy.units as u
import matplotlib.pyplot as plt
import os
%
我很难找到matplotlib显示的窗口。
我已经下载了python3.3、matplotlib for python3.3和numpy。
我还为Visual Studio 2012安装了python工具,这样我就可以在那个环境中创建python解决方案了。
所有这些都不会影响到你...我正在运行这个非常简单的脚本:
import numpy as np
import matplotlib.pyplot as plt
import pylab
# Come up with x and y
x = np.arange(0, 5, 0.1)
y = np.sin(x)
# plot the x
我正在尝试用IPython的matplotlib绘制3D散点图。当我使用内联魔术命令时,我可以绘制一个图,如下所示
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
y = np.arange(10)
x = np.arange(10)
z = np.arange(10)
plt.figure()
ax = plt.axes(projection='3d')
ax.scatter(x,y,z)
但是因为绘图
我使用Python和Flask将3D图形的X,Y,Z值提供给Javascript (Plotly库)。数据如下所示:
z = [1,1,1,1,1,1,1,1,1,1,1,1];
x = [0.0100,0.0420,0.0500,0.0508,0.0769,0.0883,0.0900,0.1101,0.1256,0.1300,0.1385,0.1607];
y = [0.0131,0.0190,0.0248,0.0250,0.0310,0.0370,0.0384,0.0430,0.0490,0.0530,0.0550,0.0610];
所有这些都是针对一个3D图形的,它看起来像这样:
我正在使用pylab生成大量的图形,我想将它们保存到磁盘上,并在脚本完成后进行检查。但是,我的特定python脚本显示了生成的每个图形,并且在数字运算和打开的大量无响应图形窗口之间的某个位置,我的系统充其量变得没有响应或迟缓。有没有办法防止pylab图形窗口在脚本执行过程中弹出?提前谢谢。
下面是用于生成几个图形的代码片段
...
import pylab as pl
...
# Create the figure (Letter format)
for r, f in enumerate(fif_queue):
fig, ax = pl.subplots(1, 1,