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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:54:35+00:00 2026-06-09T23:54:35+00:00

I have multiple datasets I want to plot in a single figure: plot data1a.txt,

  • 0

I have multiple datasets I want to plot in a single figure:

plot "data1a.txt", "data1b.txt", "data1c.txt", "data2.txt"

I want to have two y-axes with different ranges.

yrange=[0:10]
y2range=[-10:10]

This is easily done on gnuplot if you only have two datasets. The first dataset uses yrange (with it’s axis on the left hand side), and the second dataset uses y2range (with the axis on the right hand side).

Now here’s the question. I want to plot datasets data1a.txt, data1b.txt and data1c.txt using yrange, and data2.txt using y2range. How do I do this on a single figure with two y-axes?

  • 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-09T23:54:37+00:00Added an answer on June 9, 2026 at 11:54 pm

    As documented here:

    plot {<ranges>}  
          {<function> | {"<datafile>" {datafile-modifiers}}}  
          {axes <axes>} {<title-spec>} {with <style>}  
          {, {definitions,} <function> ...} 
    

    you can see that the axes are used in the plot command. After setting the ranges of your y-axes with

    set yrange [y1min:y1max]
    set y2range [y2min:y2max]
    

    you can specify which axis you want to use in your plot with

    plot "data.txt" axes x1y1
    

    if you want to plot it against the first y-axis or

    plot "data.txt" axes x1y2
    

    if you want to plot it against the second y-axis.

    Also see this example of how to use multiple axis in gnuplot.

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

Sidebar

Related Questions

I have multiple forms for lots of products on my page and want to
I have multiple websites run on single database. My question related table Structure is
I have an issue where I must shred multiple xml datasets from multiple providers
I have a DataSet with multiple tables (distinct schema). I want to generate table
I have a somewhat complex query with multiple (nested) sub-queries, which I want to
In my database one user can have multiple order. i want to get all
I have created Windows Application. In this, I have multiple tables in dataset, now
I have a dataset with multiple tables. One table in particular has one record
I have multiple ajax requests with javascript code as response, and I need to
I have multiple projects which are to be hosted together in a Tomcat container,

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.