0
我正在运行一个循环来绘制一堆不同的线条,但最有意义的是将它们绘制在loglog图上(处理大约9个数量级)。他们绘制了他们应该如何使用loglog绘图,但只有在我尝试记录绘制它们时,轴/轴标签才会消失。消失的轴,LogLog剧情Python
#THIS IS FOR A NORMAL PLOT
import matplotlib.pyplot as plt
plt.figure()
for ii in list1:
plt.plot(xarray[:], yarray[ii,:])
plt.show()
我已经尝试添加以下内容:
plt.xscale('log')
和
plt.yscale('log')
或者我试图
plt.loglog(xarray[:], yarray[ii,:])
plt.semilogy(xarray[:], yarray[ii,:])
任何帮助将是巨大的,我没有很多经验与阴谋,但麦出现的轴应该非常简单,我会想。谢谢。
编辑:我也越来越从回溯以下错误调用。我只是做了matplotlib的干净重新安装,仍然有同样的问题(它绘出但没有轴)
>Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py", line 1034, in draw
func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axes.py", line 2086, in draw
a.draw(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axis.py", line 1093, in draw
renderer)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axis.py", line 1042, in _get_tick_bboxes
extent = tick.label1.get_window_extent(renderer)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/text.py", line 754, in get_window_extent
bbox, info, descent = self._get_layout(self._renderer)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/text.py", line 329, in _get_layout
ismath=ismath)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 151, in get_text_width_height_descent
self.mathtext_parser.parse(s, self.dpi, prop)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py", line 3009, in parse
self.__class__._parser = Parser()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mathtext.py", line 2193, in __init__
- ((lbrace + float_literal + rbrace)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
你能张贴一些截图吗?我用你的代码得到了正确的结果,显示了轴。你的matplotlib版本是什么? –
我现在没有足够的声望发布照片,但我正在使用matplotlib 1.3.1版本。 – user3390046
请提供您的数据片段,以重现问题。 – sashkello