Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:31:07+00:00 2026-05-29T09:31:07+00:00

Trying to reproduce the problem from this question , I’ve found I can’t plot

  • 0

Trying to reproduce the problem from this question, I’ve found I can’t plot even a simplest contour plot.

Here is a simplified version of a (hopefelly) relevant example from the gallery

#!/usr/bin/env python
import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
#Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)   
#Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * np.exp(X-Y)  #(Z2 - Z1)

plt.figure()
CS = plt.contour(X,Y,Z)

plt.show()

which gives me this:

Traceback (most recent call last):
  File "./contour.py", line 19, in <module>
    CS = plt.contour(X,Y,Z)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/pyplot.py", line 2188, in contour
    ret = ax.contour(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/axes.py", line 7316, in contour
    return mcontour.QuadContourSet(self, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/contour.py", line 1106, in __init__
    ContourSet.__init__(self, ax, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/contour.py", line 720, in __init__
    self._process_colors()
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/contour.py", line 954, in _process_colors
    self.set_clim(self.vmin, self.vmax)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/cm.py", line 248, in set_clim
    self.changed()
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/contour.py", line 841, in changed
    self.to_rgba(self.cvalues, alpha=self.alpha)]
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/cm.py", line 214, in to_rgba
    x = self.cmap(x, alpha=alpha, bytes=bytes)
  File "/usr/local/lib/python2.6/dist-packages/matplotlib/colors.py", line 520, in __call__
    cbook._putmask(xa, xa==1.0, np.nextafter(xa.dtype.type(1),
AttributeError: 'module' object has no attribute 'nextafter'

The errors do not depend on whether I stick to the original ‘difference of Gaussians’ or try plotting just an exponential, as in the code snipped above.

Am I missing something trivial?

In case it’s relevant, I’m using matplotlib 1.1.0 on Ubuntu 10.04

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:31:08+00:00Added an answer on May 29, 2026 at 9:31 am

    No you are not doing anything wrong. You need to upgrade Numpy. I had the same issue, and following an update to Numpy 1.6.1, things worked smoothly.

    With Lucid Lynx (Ubuntu 10.04), you have access to numpy 1.3.0. The missing nextafter function is only available following numpy 1.4 (Thanks to DSM).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a library aiming to reproduce Qt's threading semantics: signals can
EDIT: Read answer number 1 from Tim Schmelter and then use this question for
I'm trying to reproduce the layout of some paper forms in a WPF application.
Trying to get my css / C# functions to look like this: body {
Trying to make a make generic select control that I can dynamically add elements
Trying to keep all the presentation stuff in the xhtml on this project and
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound
NOTE: This is a long question. I've explained all the 'basics' at the top
It is the first time I ask a question on this forum. Sorry if
I am trying to disable a sortable element from sorting when it has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.