簡體   English   中英

如何在matplotlib中調整圖表?

[英]How to adjust charts in matplotlib?

如何解決這個問題?
追溯(最近一次通話):

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\IPython\core\formatters.py", line 307, in __call__
    return printer(obj)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 240, in <lambda>
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 124, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 2252, in print_figure
    **kwargs)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 545, in print_png
    FigureCanvasAgg.draw(self)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 459, in draw
    self.renderer = self.get_renderer(cleared=True)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 476, in get_renderer
    self.renderer = RendererAgg(w, h, self.figure.dpi)

  File "C:\Users\Vrushab PC\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 93, in __init__
    self._renderer = _RendererAgg(int(width), int(height), dpi, debug=False)

ValueError: Image size of 8804752x396 pixels is too large. It must be less than 2^16 in each direction.

我認為錯誤代碼非常清楚:您嘗試繪制的圖像很大。 您必須減小圖像的尺寸,即必須縮小圖像。 您甚至想繪制大小為8804752x396嗎? 您確定以前沒有做錯什么嗎? 這似乎非常巨大。

編輯:如果您只想將圖像另存為png或類似的圖片,則嘗試將后端更改為其他內容- 在此處查找更適合您任務的后端,然后嘗試!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM