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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:14:11+00:00 2026-06-11T09:14:11+00:00

My question is very similar to this one, from which I was able to

  • 0

My question is very similar to this one, from which I was able to learn a lot. However, I am working with multiple data blocks, like this:

1 2 3
4 5 6
7 8 0
4 3 0


4 5 7
2 3 0
4 5 0
5 6 7

and I am plotting them like this:

plot "file.txt" index 0 u 1:2 w points pt 1,\
     "file.txt" index 1 u 1:2 w points pt 2

which creates 2 different sets of points, each a different color. Now, my goal is to modify this script so that if the 3rd data column is 0, the color of the point will become black. I would like for the other points to remain the colors that they currently are though (meaning different from one another). I have done this:

set palette model RGB defined ( 0 'black', 1 'green' )
unset colorbox
plot file index 0 u 1:2:( $3 == 0 ? 0 : 1 ) w points pt 1 palette,\
     file index 1 u 1:2:( $3 == 0 ? 0 : 1 ) w points pt 2 palette

This does exactly what I want, except of course both sets are now plotted in green. Is there any way to plot the black ones as desired, but also make each index a different color?

  • 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-11T09:14:12+00:00Added an answer on June 11, 2026 at 9:14 am

    It should work to define an extra point in the palette:

    set palette model RGB defined ( 0 'black', 1 'green', 2 'red')
    unset colorbox
    plot file index 0 u 1:2:( $3 == 0 ? 0 : 1 ) w points pt 1 palette,\
         file index 1 u 1:2:( $3 == 0 ? 0 : 2 ) w points pt 2 palette
    

    enter image description here

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

Sidebar

Related Questions

My question popped up a very similar question, this one . But the accepted
I have an error very similar to the one addressed in this question .
EDIT : this question is very similar to this one but it's more conceptual
i have a very similar question like this one: Rails redirect_to with params so,
My question is very similar to this one Not drawing outside bounds when clipToBounds=NO
I found a question that was very similar to this one, but using features
Preamble: My core question is very similar to this one: How can I write
My question is very similar to this one . The application I'm developing is
I know this question is very similar to this one, but I feel its
My question is very similar to this question - Addin parameter for Oracle except

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.