我已经在x64 Windows7上成功安装了python 2.6的matplotlib。 当我尝试导入matplotlib时,它显示以下错误。 我也安装了numpy,下面这个链接: 在Python 2.7.3的64位Windows 7上安装Numpy import matplotlib.pyplot as plt Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> import matplotlib.pyplot as plt File "C:\Python26\Lib\site-packages\matplotlib\__init__.py", line 110, in <module> raise ImportError("matplotlib requires dateutil") ImportError: matplotlib requires dateutil 我怎样才能使它工作? 我从http://matplotlib.org/downloads.html安装了matplotlib-1.3.0.win-amd64-py2.6.exe
我怎样才能删除matplotlib轴的一行(或多行),使得它实际上被垃圾回收并释放内存? 下面的代码似乎删除行,但从不释放内存(即使显式调用gc.collect()) from matplotlib import pyplot import numpy a = numpy.arange(int(1e7)) # large so you can easily see the memory footprint on the system monitor. fig = pyplot.Figure() ax = pyplot.add_subplot(1, 1, 1) lines = ax.plot(a) # this uses up an additional 230 Mb of memory. # can I get the memory back? l = […]
据我所知直方图function中的选项Log = True仅指y轴。 P.hist(d,bins=50,log=True,alpha=0.5,color='b',histtype='step') 我需要log10中的等分间隔。 有什么可以做到这一点?
基于这个关于matplotlib中heatmaps的问题 ,我想把x轴标题移到plot的顶部。 import matplotlib.pyplot as plt import numpy as np column_labels = list('ABCD') row_labels = list('WXYZ') data = np.random.rand(4,4) fig, ax = plt.subplots() heatmap = ax.pcolor(data, cmap=plt.cm.Blues) # put the major ticks at the middle of each cell ax.set_xticks(np.arange(data.shape[0])+0.5, minor=False) ax.set_yticks(np.arange(data.shape[1])+0.5, minor=False) # want a more natural, table-like display ax.invert_yaxis() ax.xaxis.set_label_position('top') # <– This doesn't […]
我有以下的情节: 如果它们具有相同的宽度,它会更好看。 你有任何想法如何在ipython笔记本中使用%matplotlib inline ? 更新: 要生成这两个数字我使用以下function: import numpy as np import matplotlib.pyplot as plt def show_plots2d(title, plots, points, xlabel = '', ylabel = ''): """ Shows 2D plot. Arguments: title : string Title of the plot. plots : array_like of pairs like array_like and array_like List of pairs, where first element is x axis […]
我知道如何循环matplotlib中的颜色列表。 但是有可能做一些类似的线条样式(普通,虚线,虚线等)? 我需要这样做,所以我的图表打印时会更容易阅读。 任何build议如何做到这一点?
在matplotlib中,如何将错误绘制为阴影区域而不是误差线? 例如: http://qhwiki.originlab.com/~originla/howtohttp://img.dovov.comc/cc/Error_Bars_with_Fill_Area_01.png 而不是
给定一个时间表示信号图,如何画线标记相应的时间索引? 具体来说,给定一个时间指数范围从0到2.6(s)的信号图,我想画出垂直的红线,表示列表[0.22058956, 0.33088437, 2.20589566]相应时间索引,我该怎么办?
我正在虚拟环境中使用烧瓶。 我能够用pip安装matplotlib,并且可以在Python会话中import matplotlib 。 但是,当我导入它 matplotlib.pyplot as plt 我得到以下错误: >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/pyplot.py", line 109, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "//anaconda/envs/myenv/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 24, in <module> from matplotlib.backends import _macosx RuntimeError: […]
按照设置包之间Sphinx文档链接的文档,我已经添加了 intersphinx_mapping = {'python': ('http://docs.python.org/2', None), 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), 'matplotlib': ('http://matplotlib.sourceforge.net/', None)} 到我的conf.py ,但似乎无法获得除Python本身以外的任何项目的链接工作。 例如 :term:`svg graphics <matplotlib:svg>` 只是带我到索引页面,没有添加预期的#term-svg锚点,我什至不能findscipy词汇表或找出如何确定:ref: s或:term: s是由一个包支持。 我在哪里可以find如何在numpy , scipy和matplotlib为:ref: s和:term:指定目标的说明? 对于这个问题,我怎么链接到狮身人面像? 添加 intersphinx_mapping['sphinx'] = ('http://sphinx-doc.org/', None) 和 :ref:`Intersphinx <intersphinx>` 不起作用。