我使用Matlab创build了这个图 使用matplotlib,x-axies会绘制大的数字,例如100000,200000,300000.我想要有一些像1,2,3和10 ^ 5来表明它实际上是100000,200000,300000。 有一个简单的方法来创build这样的规模在matplotlib?
自升级matplotlib以来,每当尝试创build图例时都会收到以下错误消息: /usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x3a30810>] Use proxy artist instead. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),)) /usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support [<matplotlib.lines.Line2D object at 0x3a30990>] Use proxy artist instead. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist warnings.warn("Legend does not support %s\nUse proxy artist instead.\n\nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist\n" % (str(orig_handle),)) 这甚至发生这样一个简单的脚本: import matplotlib.pyplot as […]
我使用matplotlib绘制python中的一些数据,并且绘图需要一个标准的颜色条。 数据由一系列包含频率信息的N×Mmatrix组成,以便简单的imshow()图给出具有描述颜色频率的2D直方图。 每个matrix包含不同但重叠范围内的数据。 Imshow将每个matrix中的数据标准化到0-1的范围,这意味着例如matrixA的绘图将与matrix2 * A的绘图相同(尽pipe颜色条将显示两倍的值)。 我想要的是红色,例如,对应于所有地块中的相同频率。 换句话说,一个单一的彩条就足够了所有的情节。 任何build议将不胜感激。
当前的后端名称可以通过 >>> import matplotlib.pyplot as plt >>> plt.get_backend() 'GTKAgg' 有没有办法获得可以在特定机器上使用的所有后端列表? 提前致谢。
我已经安装了matplotlib-1.2.1以及numpy-1.8.0 。 注意 – 我正在使用安装了自制软件的系统python – 我有$PYTHONPATH设置,以便从/Library/Python/xy/site-packages (其中pip安装到)加载/Library/Python/xy/site-packages 。 这里是安装matplotlib的代码(configuration) BUILDING MATPLOTLIB matplotlib: yes [1.3.1] python: yes [2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]] platform: yes [darwin] REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [version 1.8.0] dateutil: yes [using dateutil version 1.5] tornado: yes [tornado was not found. It is […]
我试图保存使用matplotlib制作的图表; 但是,图像保存为空白。 这是我的代码: plt.subplot(121) plt.imshow(dataStack, cmap=mpl.cm.bone) plt.subplot(122) y = copy.deepcopy(tumorStack) y = np.ma.masked_where(y == 0, y) plt.imshow(dataStack, cmap=mpl.cm.bone) plt.imshow(y, cmap=mpl.cm.jet_r, interpolation='nearest') if T0 is not None: plt.subplot(123) plt.imshow(T0, cmap=mpl.cm.bone) #plt.subplot(124) #Autozoom #else: #plt.subplot(124) #Autozoom plt.show() plt.draw() plt.savefig('tessstttyyy.png', dpi=100) 而tessstttyyy.png是空白的(也试图用.jpg)
你如何在pandas系列情节中绘制垂直线(vlines)? 我正在使用pandas来绘制滚动手段等,并想用垂直线标记重要的位置。 是否有可能使用vlines或类似的东西来完成这个? 如果是的话,有人可以提供一个例子吗? 在这种情况下,x轴是date时间。
我需要在文件中创build一个graphics而不在IPython笔记本中显示它。 在这方面,我不清楚IPython和matplotlib.pylab之间的交互。 但是,当我调用pylab.savefig("test.png") ,除了被保存在test.png中之外,当前的数字test.png被显示test.png 。 当自动创build大量的绘图文件时,这通常是不可取的。 或者在需要其他应用程序进行外部处理的中间文件的情况下。 不知道这是一个matplotlib或IPython笔记本问题。
给定一个均值和方差是否有一个简单的pylab函数调用将绘制一个正态分布? 还是我需要自己做一个?
如何在Matplotlib中实现多个比例? 我不是在讨论与同一个x轴绘制的主轴和副轴,而是像许多不同尺度的趋势,这些趋势在同一个y轴上绘制并且可以通过它们的颜色来标识。 例如,如果我将trend1 ([0,1,2,3,4])和trend2 ([5000,6000,7000,8000,9000])与时间作图,并希望两个趋势具有不同的颜色而在Y轴,不同的尺度,我怎样才能完成Matplotlib这个? 当我看着Matplotlib,他们说他们现在没有这个,虽然这绝对是他们的愿望清单,有没有办法做到这一点? 有没有其他的绘图工具可以使这种情况发生?