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 8981745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:24:46+00:00 2026-06-15T20:24:46+00:00

I can plot a function with variable values as large as I need in

  • 0

I can plot a function with variable values as large as I need in gnuplot 4.4:

gnuplot> t = 10000*365.25*24*3600
gnuplot> f(x) = alpha*delta*exp(-alpha*x)*(sin(omega*t-alpha*x)-cos(omega*t-alpha*x))
gnuplot> plot f(x)

But If I instead want to iterate over t using similar values as above, by using the `plot for’ command, I get segfaults or it doesn’t seem to end (I waited a long time and still no response):

tau = int(40000*365.25*24*3600)
step = int(10000*365.25*24*3600)
f(x,t) = alpha*delta*exp(-alpha*x)*(sin(omega*t-alpha*x)-cos(omega*t-alpha*x))
plot for [t=0:tau:step] f(x,t)

If I have tau = 1000, and step = 10 then there is no problem, so I’m assuming that the size of the iterables is the issue. Is there some way around this or am I doing something wrong?

Some more info following @mgilson’s answer:
My system is 64-bit, and python can handle some very large integers:

>>> import sys
>>> sys.maxint
9223372036854775807
>>> tau = int(40000*365.25*24*3600)
>>> print tau
1262304000000

While gnuplot cannot:

gnuplot> tau = int(40000*365.25*24*3600)
gnuplot> print tau
-2147483648

Here’s the plot file if you want to try it:

tau   = int(40000*365.25*24*3600)
delta = 10
kappa = 1e-6
omega = 2*pi/tau  # angular frequency
alpha = sqrt(omega/(2*kappa))  # a simplifying factor

# set the range of x and time, t
set xrange[0:3000]
step = int(10000*365.25*24*3600)

f(x,t) = alpha*delta*exp(-alpha*x)*(sin(omega*t-alpha*x)-cos(omega*t-alpha*x))
plot for [t=0:tau:step] f(x,t)
  • 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-15T20:24:47+00:00Added an answer on June 15, 2026 at 8:24 pm

    quickly putting some of this into the python interpreter:

    >>> tau = int(40000*365.25*24*3600)
    >>> tau
    1262304000000L
    >>> step = int(10000*365.25*24*3600)
    >>> step
    315576000000L
    

    Notice the L at the end of the integers? That means that these numbers overflowed the system’s maximum integer size which is:

    >>> import sys
    >>> sys.maxint   #2**31 - 1
    2147483647
    

    for my system. Python handles this gracefully by using a custom type (long) which allows the integer to occupy an unlimited number of bytes. The way gnuplot handles this is that the overflow wraps around …

    gnuplot> tau = int(40000*365.25*24*3600)
    gnuplot> print tau
    -2147483648
    

    Now you have negative numbers where you expected positive ones.

    EDIT

    It appears that gnuplot uses 4-byte integers no matter what python’s sys.maxint is. On my ubuntu x86_64 machine, python’s sys.maxint is much larger than gnuplot’s integer can handle (which is still capped at 2**31-1).

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

Sidebar

Related Questions

Can I use the arrow() function in R to plot a transparent arrow between
I wonder if there's any tool/website where I can plot some run times as
I know I can create a plot with line and dots using the type
How can I add a newline to a plot's label (e.g. xlabel or ylabel)
How can I calculate the maximum histogram value when making a plot? I want
How can I move a ggplot2 legend to the bottom of the plot and
So I have a plot of N points in the 2D plane (N can
How to plot and display Histogram of an Image ?If it can done using
I am trying to plot a variable number of lines in matplotlib where the
I need to get a plot that fits the data automatically using matplotlib. This

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.