mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 14:50:53 +07:00
PY-49055 SciView(fix): Unable to show large plots in PyCharm with sciview.
GitOrigin-RevId: 22b75d6421d69b00123ea50605eca65cdb573b3a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
22fac7715b
commit
acfac29e86
@@ -1,4 +1,6 @@
|
||||
import base64
|
||||
import io
|
||||
|
||||
import matplotlib
|
||||
import os
|
||||
import sys
|
||||
@@ -79,10 +81,11 @@ class FigureCanvasInterAgg(FigureCanvasAgg):
|
||||
def show(self):
|
||||
FigureCanvasAgg.draw(self)
|
||||
|
||||
if matplotlib.__version__ < '1.2':
|
||||
buffer = self.tostring_rgb(0, 0)
|
||||
else:
|
||||
buffer = self.tostring_rgb()
|
||||
buf = io.BytesIO()
|
||||
self.print_png(buf)
|
||||
buf.seek(0)
|
||||
buffer = buf.read()
|
||||
buf.close()
|
||||
|
||||
if len(set(buffer)) <= 1:
|
||||
# do not plot empty
|
||||
|
||||
Reference in New Issue
Block a user