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

RuntimeError: Cannot get window extent w/o renderer, with GTKAgg backend. #1

Open
phn opened this issue Oct 7, 2011 · 0 comments
Open

Comments

@phn
Copy link
Owner

phn commented Oct 7, 2011

Reported on Python 2.7, Matplotlib 1.0.1; Python 2.6, Matplotlib 0.99.3; Ubuntu 11.04 and Fedora 14.

Code sample:

import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
import lineid_plot

wave = 1240 + np.arange(300) * 0.1
flux = np.random.normal(size=300)
line_wave = [1242.80, 1260.42, 1264.74, 1265.00, 1265.2, 1265.3,
1265.35]
line_flux = np.interp(line_wave, wave, flux)
line_label1 = ['N V', 'Si II', 'Si II', 'Si II', 'Si II', 'Si II', 'Si II']
label1_sizes = np.array([12, 12, 12, 12, 12, 12, 12])

fig = plt.figure()

# First Axes
ax = fig.add_axes([0.1,0.06, 0.85, 0.35])
ax.plot(wave, flux)

# Pass the Axes instance to the plot_line_ids function.
lineid_plot.plot_line_ids(wave, flux, line_wave, line_label1, ax=ax)

# Second Axes
ax1 = fig.add_axes([0.1, 0.55, 0.85, 0.35])
ax1.plot(wave, flux)

# Pass the Axes instance to the plot_line_ids function.
lineid_plot.plot_line_ids(wave, flux, line_wave, line_label1, ax=ax1)

plt.show()

First call to plot_line_ids() raises RuntimeError.

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

1 participant