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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:42:24+00:00 2026-05-16T22:42:24+00:00

Is it possible to pass to plot data in a string? I mean do

  • 0

Is it possible to pass to plot data in a string?

I mean do something like this:

plot "09-13-2010,2263.80 09-14-2010,2500" using 1:2 with lines
  • 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-16T22:42:25+00:00Added an answer on May 16, 2026 at 10:42 pm

    It is possible to do something like:

    set xdata time
    set timefmt "%m-%d-%y"     
    plot "< echo '09-13-2010,2263.80 09-14-2010,2500' | tr ' ' '\n' | tr ',' ' '" using 1:2 with lines
    

    Where the < character indicates to Gnuplot that we want our input from the output of a command. Gnuplot separates records with a newline. Groups of records are separated by a blank record. Within a record, the default column separator is a space. In the above example tr is used to split your data into lines, and the rewrite the lines into records.

    Another way to plot your data from a string is to use the “-” input specifier, and then load the data in from the command line. A program could easily emit the following:

    set xdata time
    set timefmt "%m-%d-%y"
    plot '-' using 1:2 with lines
    09-13-2010 2263.80
    09-14-2010 2500
    e
    

    Your best bet is to use an input file like:

    09-13-2010 2263.80
    09-14-2010 2500
    

    Assuming the input file is named mydata.txt, you can then plot it with the commands:

    set xdata time
    set timefmt "%m-%d-%y"
    plot 'mydata.txt' using 1:2 with lines
    

    All the examples above give you something like:
    alt text

    If you want to plot two data series using dates and the `-‘ input you could do the following:

    set xdata time
    set timefmt "%m-%d-%y"
    plot '-' using 1:2  title "Series 1" with lines,'-' using 1:2 title "Series 2" with lines
    09-13-2010 2263.80
    09-14-2010 2500
    e
    09-13-2010 2500
    09-14-2010 2263.80
    e
    

    The previous example gives:
    alt text

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

Sidebar

Related Questions

Is it possible to pass a Dictionary<String, String> (or something similar; like a key/value
Possible Duplicate: Pass a PHP string to a Javascript variable (and escape newlines) I
Is it possible to pass a App setting string in the web.config to a
Possible Duplicate: Is it possible to pass parameters by reference using call_user_func_array()? I have
Is is possible to pass options to a find_or_create method? I'd like to include
When queuing a new build using VS it is possible to pass in arguments
It is possible to pass uninitialized object to a parent class like in the
Is it possible to pass native JavaScript objects such as arrays and hash-map-like objects
Is it possible to pass a pointer to a QObject using QMimeData during drag-and-drop
Is it possible to pass an array of string to a method exposed by

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.