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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:00:28+00:00 2026-06-09T10:00:28+00:00

I have some X Y Z data in a file and I’m using gnuplot

  • 0

I have some X Y Z data in a file and I’m using gnuplot to display it.
I am creating a heat map, ie. a 2D plot where the Z value is presented using color.
Right now I’m using the following script:

set palette defined (0 "blue", 1 "red")
plot "xyz.dat" u $1:$2:$3 w image

My problem is, gnuplot ignores the 0 and 1 in the palette definition. It uses the colors specified, but rescales according to the minimal and maximal Z value in the file.
This makes it hard to visually compare different plots whose z range is different.

How do I tell gnuplot to stop rescaling the z color range?

  • 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-09T10:00:31+00:00Added an answer on June 9, 2026 at 10:00 am

    The “set palette defined” command maps the grey values that you would get if you were plotting using greyscale onto a color palette; the scaling to min -> 0 and max -> 1 is how it’s supposed to work. If you want to make a set of plots all with the same scaling of the data, you want to use the “set cbrange” command. For example,

      set cbrange [0:0.5]
      set palette defined (0 "blue", 1 "red")
      splot '++' using 1:2:(sin($1)*cos($2)) w image
    

    gives you an image plot with the maximum data value of 0.5 mapped to red and 0 mapped to blue.
    Subsequent plots, like

      splot '++' using 1:2:(0.5*sin($1)*cos($2)) w image
    

    will use the same scaling, so they can be compared.

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

Sidebar

Related Questions

i am generating *.reg file using code which will have some important data. and
We have some C# code that reads data from a text file using a
I have some data provided from a file.txt wich are display like this :
I am using a text file to have some data there for later purposes.
I have some data and need to create a json file with this structure
i am getting problem as i have some data in a database tabel file
I have some configuration data in a config file that I read off disk
I have a file, where I want to copy some data of the file
I have one problem , I want to get some data from XML file
I have a file containing some data (for example, 00927E2B112DB958......). This data is a

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.