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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:38:07+00:00 2026-06-05T15:38:07+00:00

When plotting color-maps using gnuplot, I usually use the following lines: … set palette

  • 0

When plotting color-maps using gnuplot, I usually use the following lines:

  ...
  set palette rgbformulae 33,13,10
  plot "file.dat" using 1:2:3 with points pointtype '7' palette

Usually the range of the third point (appearing in the legend) is automatically set by gnuplot. But how can I change that? say I want the range of the 3rd point to be from 0 to 1500.

Any suggestions?

  • 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-05T15:38:09+00:00Added an answer on June 5, 2026 at 3:38 pm

    This is actually a really good question — assuming you mean that you want the colorbar range to be determined (not the legend [i.e. key] — the legend doesn’t typically have that information).

    My first thought was set cbrange. This might do what you want —

    set cbrange [0:1500]
    set palette rgbformulae 33,13,10
    plot "file.dat" u 1:2:3 w p pt 7 palette
    

    However, the question is then “What do you want to happen to out of range points?” This solution will move out of range points to the bottom/top of the scale (e.g. purple for negative numbers, red for numbers greater than 1500). My next thought was that you should be able to clip those points out by set zrange [0:1500] — But that doesn’t work. You have at least 2 options at this point.

    Option 1: use splot:

    set view map
    set cbrange [0:1500]
    set zrange [0:1500]
    set palette rgbformulae 33,13,10
    splot "file.dat" u 1:2:3 w p pt 7 palette
    

    Your borders will be slightly different than they were before, but that’s no real big deal.

    Option 2: filter with the ternary operator (which you already know about from your previous question):

    set cbrange [0:1500]
    set palette rgbformulae 33,13,10
    inrange(c)=((c>=0) && (c<=1500))? c : (1/0)
    plot "file.dat" u 1:2:(inrange($3)) w p pt 7 palette
    

    Also, for plotting color maps, you may want to look into the pm3d plotting style (image might work too). You might need to restructure your datafile slightly, but plotting color maps is that plotting style’s bread-and-butter.

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

Sidebar

Related Questions

I am plotting 20 different lines on a single plot using matplotlib. I use
I am plotting two lines using plot(x, y, type = l, color = red)
When plotting a function using Plot, I would like to obtain the set of
I am plotting data in a plot using wxPython where the data limits on
I am plotting some curves using twin-axis and also scientific notation. I have set
I am plotting a continuous variable against a factor using plot() in R (see
I am Plotting a pixel on the screen from the following code using Assembly
I'm plotting the figure below using R's plot() function. It is a plot of
I'm plotting several images at once, sharing axes, because I use it for exploratory
Possible Duplicate: Plotting with Python I've been using Matprolib for plotting. I've found it

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.