Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pair of floats breaks plotting renderer (weirdest bug I've ever seen) #6393

Closed
aaronm6 opened this issue May 10, 2016 · 10 comments
Closed

Pair of floats breaks plotting renderer (weirdest bug I've ever seen) #6393

aaronm6 opened this issue May 10, 2016 · 10 comments
Milestone

Comments

@aaronm6
Copy link

aaronm6 commented May 10, 2016

I'm using IPython interactive, including a from pylab import *

A plot I was trying to make was breaking my renderer. I simplified the problem to the following line:

plot(array([179.5, 175.]),'o')

The data points get plotted, but the ytick labels don't finish rendering. The error messages (copied at the end of this message) get written to the terminal, and get re-written each time I try to do anything, until the figure is cleared. The choice of marker doesn't affect the behavior. There is some flexibility in choice of data values, but if I increase the first element to 179.6, I get no error.

Additional weirdness: This is only a problem when rcParams['font.size'] is set to 12. The problem goes away if I choose a smaller or larger font.

As I normally don't use 12pt font, I've never noticed this problem before, but I've verified that it also happens with my installation using python2.7 (which appears to be using the same version of matplotlib anyhow). Does anyone have an idea what might be going on?

Thanks!

Here are some details of my setup:

python3.4
IPython v3.4.4
Matplotlib v1.5.1
Using matplotlib backend: MacOSX
numpy v1.11.0
OS X (10.10.5)
Installed with MacPorts

Here is the error message I get:

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/figure.py", line 1159, in draw
    func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axes/_base.py", line 2324, in draw
    a.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axis.py", line 1111, in draw
    tick.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axis.py", line 252, in draw
    self.label1.draw(renderer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py", line 61, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/text.py", line 792, in draw
    mtext=mtext)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/backends/backend_macosx.py", line 124, in draw_tex
    Z = texmanager.get_grey(s, size, self.dpi*scale)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/texmanager.py", line 584, in get_grey
    X = read_png(os.path.join(self.texcache, pngfile))
SystemError: error return without exception set

 If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

 You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

 Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True
@WeatherGod
Copy link
Member

I know what the error means. Do you have usetex=True anywhere? Try turning
it off for a moment. I bet something is wrong with LaTeX.
On May 9, 2016 9:08 PM, "aaronm6" notifications@github.com wrote:

I'm using IPython interactive, including a from pylab import *

A plot I was trying to make was breaking my renderer. I simplified the
problem to the following line:

plot(array([179.5, 175.]),'o')

The data points get plotted, but the ytick labels don't finish rendering.
The error messages (copied at the end of this message) get written to the
terminal, and get re-written each time I try to do anything, until the
figure is cleared. The choice of marker doesn't affect the behavior. There
is some flexibility in choice of data values, but if I increase the first
element to 179.6, I get no error.

Additional weirdness: This is only a problem when rcParams['font.size']
is set to 12. The problem goes away if I choose a smaller or larger font.

As I normally don't use 12pt font, I've never noticed this problem before,
but I've verified that it also happens with my installation using python2.7
(which appears to be using the same version of matplotlib anyhow). Does
anyone have an idea what might be going on?

Thanks!

Here are some details of my setup:

python3.4
IPython v3.4.4
Matplotlib v1.5.1
Using matplotlib backend: MacOSX
numpy v1.11.0
OS X (10.10.5)
Installed with MacPorts

Here is the error message I get:

File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py",
line 61, in draw_wrapper
draw(artist, renderer, _args, *_kwargs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/figure.py",
line 1159, in draw
func(

_args) File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py",
line 61, in draw_wrapper draw(artist, renderer, *args, *_kwargs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axes/_base.py",
line 2324, in draw
a.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py",
line 61, in draw_wrapper
draw(artist, renderer, _args, *_kwargs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axis.py",
line 1111, in draw
tick.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py",
line 61, in draw_wrapper
draw(artist, renderer, _args, *_kwargs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/axis.py",
line 252, in draw
self.label1.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/artist.py",
line 61, in draw_wrapper
draw(artist, renderer, _args, _kwargs)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/text.py",
line 792, in draw
mtext=mtext)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/backends/backend_macosx.py",
line 124, in draw_tex
Z = texmanager.get_grey(s, size, self.dpi
scale)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/texmanager.py",
line 584, in get_grey
X = read_png(os.path.join(self.texcache, pngfile))
SystemError: error return without exception set

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use
"%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6393

@tacaswell
Copy link
Member

Can you please provide your full rcparams? I can not reproduce this.

If you just save a png does it work?

@aaronm6
Copy link
Author

aaronm6 commented May 12, 2016

@WeatherGod , @tacaswell : Thanks for your replies!

My rcParams are below. @WeatherGod , yes I do indeed have usetex=True.

@tacaswell Interestingly.... now I can't reproduce it either! I'm on a different computer at the moment, but the only difference in software is one recent mac ports update (on the machine for which this is a problem). Incidentally, yes I was able to save to png successfully when I was getting this problem. I'll be in front of the original computer tomorrow and follow up on both of your questions.

RcParams({'agg.path.chunksize': 0,
'animation.avconv_args': [],
'animation.avconv_path': 'avconv',
'animation.bitrate': -1,
'animation.codec': 'mpeg4',
'animation.convert_args': [],
'animation.convert_path': 'convert',
'animation.ffmpeg_args': [],
'animation.ffmpeg_path': 'ffmpeg',
'animation.frame_format': 'png',
'animation.html': 'none',
'animation.mencoder_args': [],
'animation.mencoder_path': 'mencoder',
'animation.writer': 'ffmpeg',
'axes.axisbelow': False,
'axes.edgecolor': 'k',
'axes.facecolor': 'w',
'axes.formatter.limits': [-3, 4],
'axes.formatter.use_locale': False,
'axes.formatter.use_mathtext': False,
'axes.formatter.useoffset': True,
'axes.grid': False,
'axes.grid.axis': 'both',
'axes.grid.which': 'major',
'axes.hold': True,
'axes.labelcolor': 'k',
'axes.labelpad': 5.0,
'axes.labelsize': 'medium',
'axes.labelweight': 'normal',
'axes.linewidth': 1.0,
'axes.prop_cycle': cycler('color', ['b', 'g', 'r', 'c', 'm', 'y', 'k']),
'axes.spines.bottom': True,
'axes.spines.left': True,
'axes.spines.right': True,
'axes.spines.top': True,
'axes.titlesize': 'large',
'axes.titleweight': 'normal',
'axes.unicode_minus': True,
'axes.xmargin': 0.0,
'axes.ymargin': 0.0,
'axes3d.grid': True,
'backend': 'MacOSX',
'backend.qt4': 'PyQt4',
'backend.qt5': 'PyQt5',
'backend_fallback': True,
'boxplot.bootstrap': None,
'boxplot.boxprops.color': 'b',
'boxplot.boxprops.linestyle': '-',
'boxplot.boxprops.linewidth': 1.0,
'boxplot.capprops.color': 'k',
'boxplot.capprops.linestyle': '-',
'boxplot.capprops.linewidth': 1.0,
'boxplot.flierprops.color': 'b',
'boxplot.flierprops.linestyle': 'none',
'boxplot.flierprops.linewidth': 1.0,
'boxplot.flierprops.marker': '+',
'boxplot.flierprops.markeredgecolor': 'k',
'boxplot.flierprops.markerfacecolor': 'b',
'boxplot.flierprops.markersize': 6.0,
'boxplot.meanline': False,
'boxplot.meanprops.color': 'r',
'boxplot.meanprops.linestyle': '-',
'boxplot.meanprops.linewidth': 1.0,
'boxplot.medianprops.color': 'r',
'boxplot.medianprops.linestyle': '-',
'boxplot.medianprops.linewidth': 1.0,
'boxplot.notch': False,
'boxplot.patchartist': False,
'boxplot.showbox': True,
'boxplot.showcaps': True,
'boxplot.showfliers': True,
'boxplot.showmeans': False,
'boxplot.vertical': True,
'boxplot.whiskerprops.color': 'b',
'boxplot.whiskerprops.linestyle': '--',
'boxplot.whiskerprops.linewidth': 1.0,
'boxplot.whiskers': 1.5,
'contour.corner_mask': True,
'contour.negative_linestyle': 'dashed',
'datapath': '/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/matplotlib/mpl-data',
'docstring.hardcopy': False,
'errorbar.capsize': 3.0,
'examples.directory': '',
'figure.autolayout': False,
'figure.dpi': 80.0,
'figure.edgecolor': 'w',
'figure.facecolor': '0.75',
'figure.figsize': [8.0, 6.0],
'figure.frameon': True,
'figure.max_open_warning': 20,
'figure.subplot.bottom': 0.1,
'figure.subplot.hspace': 0.2,
'figure.subplot.left': 0.125,
'figure.subplot.right': 0.9,
'figure.subplot.top': 0.9,
'figure.subplot.wspace': 0.2,
'figure.titlesize': 'medium',
'figure.titleweight': 'normal',
'font.cursive': ['Apple Chancery',
'Textile',
'Zapf Chancery',
'Sand',
'Script MT',
'Felipa',
'cursive'],
'font.family': ['serif'],
'font.fantasy': ['Comic Sans MS',
'Chicago',
'Charcoal',
'ImpactWestern',
'Humor Sans',
'fantasy'],
'font.monospace': ['Bitstream Vera Sans Mono',
'DejaVu Sans Mono',
'Andale Mono',
'Nimbus Mono L',
'Courier New',
'Courier',
'Fixed',
'Terminal',
'monospace'],
'font.sans-serif': ['Bitstream Vera Sans',
'DejaVu Sans',
'Lucida Grande',
'Verdana',
'Geneva',
'Lucid',
'Arial',
'Helvetica',
'Avant Garde',
'sans-serif'],
'font.serif': ['Palatino'],
'font.size': 12.0,
'font.stretch': 'normal',
'font.style': 'normal',
'font.variant': 'normal',
'font.weight': 'normal',
'grid.alpha': 1.0,
'grid.color': 'k',
'grid.linestyle': ':',
'grid.linewidth': 0.5,
'image.aspect': 'equal',
'image.cmap': 'jet',
'image.composite_image': True,
'image.interpolation': 'bilinear',
'image.lut': 256,
'image.origin': 'upper',
'image.resample': False,
'interactive': True,
'keymap.all_axes': ['a'],
'keymap.back': ['left', 'c', 'backspace'],
'keymap.forward': ['right', 'v'],
'keymap.fullscreen': ['f', 'ctrl+f'],
'keymap.grid': ['g'],
'keymap.home': ['h', 'r', 'home'],
'keymap.pan': ['p'],
'keymap.quit': ['ctrl+w', 'cmd+w'],
'keymap.save': ['s', 'ctrl+s'],
'keymap.xscale': ['k', 'L'],
'keymap.yscale': ['l'],
'keymap.zoom': ['o'],
'legend.borderaxespad': 0.5,
'legend.borderpad': 0.4,
'legend.columnspacing': 2.0,
'legend.edgecolor': 'inherit',
'legend.facecolor': 'inherit',
'legend.fancybox': False,
'legend.fontsize': 'large',
'legend.framealpha': None,
'legend.frameon': True,
'legend.handleheight': 0.7,
'legend.handlelength': 2.0,
'legend.handletextpad': 0.8,
'legend.isaxes': True,
'legend.labelspacing': 0.5,
'legend.loc': 'upper right',
'legend.markerscale': 1.0,
'legend.numpoints': 2,
'legend.scatterpoints': 3,
'legend.shadow': False,
'lines.antialiased': True,
'lines.color': 'b',
'lines.dash_capstyle': 'butt',
'lines.dash_joinstyle': 'round',
'lines.linestyle': '-',
'lines.linewidth': 2.0,
'lines.marker': 'None',
'lines.markeredgewidth': 0.5,
'lines.markersize': 6.0,
'lines.solid_capstyle': 'projecting',
'lines.solid_joinstyle': 'round',
'markers.fillstyle': 'full',
'mathtext.bf': 'serif:bold',
'mathtext.cal': 'cursive',
'mathtext.default': 'it',
'mathtext.fallback_to_cm': True,
'mathtext.fontset': 'cm',
'mathtext.it': 'serif:italic',
'mathtext.rm': 'serif',
'mathtext.sf': 'sans-serif',
'mathtext.tt': 'monospace',
'nbagg.transparent': True,
'patch.antialiased': True,
'patch.edgecolor': 'k',
'patch.facecolor': 'b',
'patch.linewidth': 1.0,
'path.effects': [],
'path.simplify': True,
'path.simplify_threshold': 0.1111111111111111,
'path.sketch': None,
'path.snap': True,
'pdf.compression': 6,
'pdf.fonttype': 3,
'pdf.inheritcolor': False,
'pdf.use14corefonts': False,
'pgf.debug': False,
'pgf.preamble': [],
'pgf.rcfonts': True,
'pgf.texsystem': 'xelatex',
'plugins.directory': '.matplotlib_plugins',
'polaraxes.grid': True,
'ps.distiller.res': 6000,
'ps.fonttype': 3,
'ps.papersize': 'letter',
'ps.useafm': False,
'ps.usedistiller': False,
'savefig.bbox': 'tight',
'savefig.directory': '~',
'savefig.dpi': 100.0,
'savefig.edgecolor': 'w',
'savefig.facecolor': 'w',
'savefig.format': 'png',
'savefig.frameon': True,
'savefig.jpeg_quality': 95,
'savefig.orientation': 'portrait',
'savefig.pad_inches': 0.1,
'savefig.transparent': False,
'svg.fonttype': 'path',
'svg.image_inline': True,
'svg.image_noscale': False,
'text.antialiased': True,
'text.color': 'k',
'text.dvipnghack': None,
'text.hinting': 'auto',
'text.hinting_factor': 8,
'text.latex.preamble': [],
'text.latex.preview': False,
'text.latex.unicode': False,
'text.usetex': True,
'timezone': 'UTC',
'tk.window_focus': False,
'toolbar': 'toolbar2',
'verbose.fileo': 'sys.stdout',
'verbose.level': 'silent',
'webagg.open_in_browser': True,
'webagg.port': 8988,
'webagg.port_retries': 50,
'xtick.color': 'k',
'xtick.direction': 'in',
'xtick.labelsize': 'medium',
'xtick.major.pad': 4.0,
'xtick.major.size': 4.0,
'xtick.major.width': 0.5,
'xtick.minor.pad': 4.0,
'xtick.minor.size': 2.0,
'xtick.minor.visible': False,
'xtick.minor.width': 0.5,
'ytick.color': 'k',
'ytick.direction': 'in',
'ytick.labelsize': 'medium',
'ytick.major.pad': 4.0,
'ytick.major.size': 4.0,
'ytick.major.width': 0.5,
'ytick.minor.pad': 4.0,
'ytick.minor.size': 2.0,
'ytick.minor.visible': False,
'ytick.minor.width': 0.5})

@aaronm6
Copy link
Author

aaronm6 commented May 12, 2016

@WeatherGod : Yes, indeed setting rcParams['text.usetex'] = False mitigates the problem. Doing so also changes the font from Palatino to Times New Roman... for some reason.

It's just strange, though; I can't imagine a "feature" that would make tex have difficulty rendering a simple set of digits, and only at 12pt font. I can put these exact numbers into a latex doc (at 12pt font) and they render fine.

Anyways, I guess this is more of just a quirky minor annoyance than anything else. Thanks for your guys' time!

@efiring efiring closed this as completed Jul 15, 2016
@anntzer
Copy link
Contributor

anntzer commented Nov 3, 2016

@efiring Why was this closed? Shouldn't at least the "error return without exception set" SystemError be fixed?

Reopening so that we don't lose track of the issue, but feel free to reclose it of course.

@anntzer anntzer reopened this Nov 3, 2016
@QuLogic
Copy link
Member

QuLogic commented Nov 3, 2016

That error was noted in #5495; I think it was fixed by #5515.

@anntzer
Copy link
Contributor

anntzer commented Nov 3, 2016

The OP was on 1.5.1, which should already include #5515...

@QuLogic
Copy link
Member

QuLogic commented Nov 3, 2016

That milestone is wrong; should be 2.0. Doesn't look like it was backported any further.

@anntzer
Copy link
Contributor

anntzer commented Nov 3, 2016

@aaronm6 can you check whether the issue is still present on 2.0b4 for you?

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Nov 8, 2016
@QuLogic
Copy link
Member

QuLogic commented Feb 6, 2017

2.0.0 is out now and there has been no comment in 9 months, so I'm going to close this issue.

@QuLogic QuLogic closed this as completed Feb 6, 2017
@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.0.1 (next bug fix release) Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants