This is an offshoot of this question here, albeit a bit more complicated (or it seems).
Using Gnuplot to plot point colors conditionally
Here is the deal. I have two different files. One file has optimal data points and one file has infeasible and non-optimal data points.
The files are in the same format as in the previous question, but I will post them again later.
My aim to plot everything on one single 3D scatter plot with impulses (probably).
Imagine, I have a constraints that say Xvalue > 18, Yvalue < 20 and Zvalue > 65. Typical ranges are X=[0:22], Y=[0:500], Z=[0:85] (small changes from the last post).
Any points that do not meet this criteria are infeasible and HAVE to be plotted in grey. Any points that meet this criteria but are from the non_optimal_file.dat HAVE to be plotted in red. And finally, the points that are in the optimal_data.dat file have to plotted in blue. It goes without saying that the points in those files have to be feasible.
I was using @andyras's solution and could work out the first part of the problem. But when I incorporated the other file into the same plot, it just turned all the points grey. I redefined my palette etc., but was able to get the infeasible and non-optimal points in blue and red, not grey and red. I was able to plot the optimal ones in black, but I am not able to use any other colors. Can someone please guide me with setting the palette for this problem?
I used this:
set palette defined (0 0 0 1, 1 1 0 0, 2 1 0 0) # (blue, yellow, red)
>splot 'data.dat' using 2:1:3:(isbig($2,$1,$3)) with points pt 8 palette notitle, \
> '' using (1e6):1:1 with points pt 8 lc rgb 'blue' title 'Optimal non-pareto', \
> '' using (1e6):1:1 with points pt 8 lc rgb 'red' title 'Non-optimal',
"./8_77_pareto_data.dat" u 2:1:3:(isbig($2,$1,$3)) w i lt 3 lc rgb 'black' t "Optimal
pareto"
The data file is in the same format as the previous case. I need to use the first three columns in the order 2:1:3 as X:Y:Z.
Sample data: Optimal points:
20 10.078509647223639 50 172
46 10.395137748213685 43 18
34 10.1846571593967 33 18
74 11.054241806019 42 18
34 11.472806910917914 30 92
Non-optimal/infeasible points:
20 9.835854999471227 42 35
20 11.901179073913957 44 35
20 12.204287402540535 51 35
255 15.216006917180689 66 172
20 11.651167171495924 52 172
20 11.89284904845455 48 172
I was guided to create a new question for this since it was slightly different. And hence the offshoot. Apologies if it was not to be done.