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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:08:19+00:00 2026-05-28T13:08:19+00:00

I have an automated script that generates a graph every day using GNUPlot. The

  • 0

I have an automated script that generates a graph every day using GNUPlot. The amount of data used for the graph grows every day, so my x-ticks get cluttered after a while. Can I somehow limit the number of major x-ticks so that I always see 5, no matter how many points are plotted?

Edit: My comment wasn’t clear enough. This is the way I do it at the moment:
I have a variable var that contains a duration, more exactly the number of seconds in 9 days:

var = 9*86400

And I use set xtics <start>, <incr> to tell GNUPlot to only show a tick for every 9 days of data:

set xtics “20111101”, var

The problem is I have to manually change this every once in a while, since the amount of data grows. Could I somehow tell GNUPlot to limit the number of xticks? Or could I somehow change the variable var to include number of plotted points? (couldn’t find out how to do this, either)

  • 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-28T13:08:19+00:00Added an answer on May 28, 2026 at 1:08 pm

    Something like this perhaps. I am assuming you are feeding the input data to this script, and that the number of lines of data decides how many x ticks you will need.

    #!/bin/sh
    
    t=$(mktemp -t ggplot.XXXXXXX)
    trap 'rm -f $t' 0          # Remove temp file at script end
    trap 'exit 127' 1 2 3 5 15 # Remove temp file if interrupted, also
    
    cat >$t
    
    # 24*60*60/5
    xticks=$(awk 'END { print 17280*NR }' $t)
    
    gnuplot <<EOF
    # Generated Gnuplot script
    set xlabel "blah blah blah, etc"
    set xtics "20111101",$xticks
    plot [:] '$t'
    EOF
    

    (Sorry, my Gnuplot skills are obviously not very good any more.)

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

Sidebar

Related Questions

For automated testing (using Hudson) I have a script that generates a bunch of
I have an automated test running on my program that generates some large MPG
I am trying to have an automated script that enters into the most recently
I have a script that downloads data from a database into a series of
We have an automated script that runs svn update. The updates can be potentially
I have an automated job that pulls files that are uploaded to our servers
SQL Server 2008 provides the ability to script data as Insert statements using the
I have a home-grown automated build script in the form of a DOS batch
I have a Tcl script controlling an automated tester. So far it was a
Possible Duplicate: PHP Curl script to pull data from remote server every 10 minutes

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.