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

  • SEARCH
  • Home
  • 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 7923309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:16:37+00:00 2026-06-03T17:16:37+00:00

I have a very long code in Python so I can’t write it all

  • 0

I have a very long code in Python so I can’t write it all here. Anyhow, the problem is that I’m plotting a function in the code with the semilogx command and everything works fine. However, if I switch to the plot command I got this error:

TypeError: ‘bool’ object is not callable

What do you think might cause the problem?

It seems that anywhere I use the plot command in the code I get the same error.
I tried plotting the first variable that I use in my code:

 f=loadtxt(folder_out+"stars/stars"+str(output)+".txt",skiprows=2)
 ids=f[:,0]
 mass_star=f[:,1] # mass in Msun
 x=f[:,2]
 y=f[:,3]
 z=f[:,4]
 age=f[:,5] # age in Myr

 plot(x,y,'.')

And the last line gives me the error. I’m sure I read the variable from the file, they have the same dimension.

  • 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-06-03T17:16:38+00:00Added an answer on June 3, 2026 at 5:16 pm

    Your error indicates that plot is not a function, as you think it is, but a bool (ie. True or False, the result of a boolean expression). This could be for a couple of reasons:

    • You explicitly assign a bool to a variable named plot (perhaps in a loop — remember that loops and if statements in Python do not create a new scope)
    • You have a bunch of from whatever import * statements, one of which imports a name plot which is clobbering the one from pylab (it might even be a from whatever import plot that you haven’t noticed)

    You could try to narrow it down by a simple text search for plot to see if you’re doing it explicitly. You could also remove imports and strip down your script until it works as expected, and try to identify the problematic line.

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

Sidebar

Related Questions

I have the following code in specman: var x := some.very.long.path.to.a.variable.in.another.struct; while (x ==
I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now
I have a very long javascript (so long that it's too long to escape
We have a very long form that has a number of fields and 2
As background I have a very long ID that too long to display in
I have a very long line of HTML. I tried turning: <code><othercode> into <code><
I have a large amount of python code that tries to handle numbers with
I have a need for a high-performance string hashing function in python that produces
I am a very newbie in Python I have the following code: from SOAPpy
Problem: I have a monitor program in Python that uses subprocess' Popen to start

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.