3
$\begingroup$

I am trying to plot the 4D Poincaré surface of section, using Hue, specifying one dimension with the color. I have pasted my code below

xdata = DATA[[All, {3, 7, 8, 9}]]; (*r,pr,p\[Theta],p\[Phi]*) Legended[ Graphics3D[{PointSize[0.006], Point[xdata[[All, 1 ;; 3]], VertexColors -> Hue /@ Rescale[xdata[[All, 4]]]]}, Axes -> True, Lighting -> "Neutral", Background -> White, BoxRatios -> {1, 1, 1/GoldenRatio}, ImageSize -> 400, AxesLabel -> {"r", "\!\(\*SuperscriptBox[\(P\), \(r\)]\)", "\!\(\*SuperscriptBox[\(P\), \(\[Theta]\)]\)"}, BaseStyle -> 15], BarLegend[{Hue, MinMax@xdata[[All, 4]]}, LegendLabel -> Style[Superscript["P", "\[Phi]"], 15]]] 

I have pasted the picture that I obtained from my code. But I don't want Magenta or Pink color, I would like to start from Blue, and include Red, and Green. enter image description here I have also tried using BarLegend[{Hue[1 - #] &, {0.3, 1}}], but its not working.

Could anyone help or guide me, how should modify the code such that I don't have pink?

The data is given below. I would like to make the plot nicer and more readable.

xdata={{101/10, 0, 0.0175023, 0.0282857}, {9.72571, 0.0252864, 0.0177705, 0.0313029}, {8.86627, 0.0400023, 0.0182543, 0.0396805}, {7.99722, 0.034791, 0.0180015, 0.0510716}, {7.5514, 0.00283825, 0.0175918, 0.0584877}, {7.88674, -0.03086, 0.0179656, 0.0527896}, {8.71585, -0.0408904, 0.0182233, 0.0414213}, {9.60384, -0.0285273, 0.0179083, 0.0323441}, {10.0945, -0.00435271, 0.0174609, 0.0283408}, {9.82553, 0.0216834, 0.0177437, 0.0304542}, {9.01446, 0.0387721, 0.0181589, 0.0380754}, {8.12171, 0.0370461, 0.018147, 0.0492052}, {7.57287, 0.0097569, 0.0175842, 0.0581034}, {7.7848, -0.0274418, 0.0178509, 0.0544434}, {8.57303, -0.0407969, 0.0182587, 0.0431413}, {9.47737, -0.0316459, 0.0179528, 0.0334925}, {10.0591, -0.00851805, 0.0175354, 0.0285993}, {9.92193, 0.0178402, 0.0176142, 0.0296854}, {9.15814, 0.0370983, 0.0181672, 0.0365637}, {8.2514, 0.0391195, 0.0181322, 0.0473727}, {7.61756, 0.0151874, 0.0177082, 0.0573002}, {7.70123, -0.0220209, 0.0177528, 0.0558539}, {8.42564, -0.0407791, 0.0182217, 0.045017}, {9.34278, -0.0341331, 0.018057, 0.0347471}, {10.0115, -0.0128414, 0.0175456, 0.028976}, {9.9908, 0.013936, 0.0175958, 0.0291289}, {9.30595, 0.0348178, 0.0180419, 0.0351111}, {8.38878, 0.0404034, 0.0182524, 0.0454942}, {7.67967, 0.0210364, 0.0176973, 0.0562262}, {7.63212, -0.0172103, 0.0177169, 0.0570431}, {8.29049, -0.0392496, 0.0181765, 0.0468296}, {9.19734, -0.0366131, 0.0181216, 0.0361753}, {9.94087, -0.016696, 0.0176276, 0.0295262}, {10.0504, 0.00965799, 0.0175128, 0.0286746}, {9.43743, 0.0324222, 0.0180143, 0.0338514}, {8.53226, 0.0407733, 0.018212, 0.0436597}, {7.76075, 0.0258635, 0.0178752, 0.0548381}, {7.58327, -0.0110042, 0.0175839, 0.0579195}, {8.15527, -0.0380062, 0.0181505, 0.0487188}, {9.0573, -0.0382121, 0.0181648, 0.037617}, {9.85402, -0.020739, 0.0176968, 0.0302271}, {10.0849, 0.00560143, 0.0174966, 0.0284063}, {9.57326, 0.0293441, 0.0178953, 0.0326241}, {8.67453, 0.041054, 0.0182693, 0.0419012}, {7.85701, 0.0299696, 0.0178853, 0.0532728}, {7.55561, -0.00494845, 0.0176358, 0.0584065}, {8.03196, -0.035188, 0.0180224, 0.0505481}, {8.90435, -0.0398756, 0.0182395, 0.0392577}, {9.75594, -0.0242015, 0.0177625, 0.0310431}, {10.1012, 0.00110804, 0.0174815, 0.0282824}, {9.68981, 0.0263081, 0.0178263, 0.0316017}, {8.8267, 0.0401369, 0.0182223, 0.040137}, {7.96479, 0.0339089, 0.0180344, 0.0515603}, {7.54859, 0.00128406, 0.0175353, 0.0585444}, {7.91607, -0.0322422, 0.0180139, 0.0523187}, {8.76072, -0.0405031, 0.0182142, 0.0408986}, {9.6366, -0.0277414, 0.0178814, 0.032058}, {10.0983, -0.00301582, 0.0174689, 0.0283087}, {9.80031, 0.0226226, 0.0177445, 0.0306679}, {8.9694, 0.0393247, 0.0182039, 0.038551}, {8.08656, 0.0362254, 0.018079, 0.0497309}, {7.56503, 0.00792083, 0.0176354, 0.0582376}, {7.81231, -0.028405, 0.0178362, 0.0539981}, {8.61147, -0.041053, 0.0182812, 0.0426617}, {9.51752, -0.0307016, 0.0179191, 0.0331283}, {10.0698, -0.00744551, 0.0175241, 0.0285174}, {9.89605, 0.0190532, 0.0176455, 0.0298907}, {9.12091, 0.0374788, 0.018161, 0.0369502}, {8.21246, 0.0388973, 0.0181519, 0.0479087}, {7.60291, 0.0134593, 0.0176315, 0.0575672}, {7.72365, -0.0235416, 0.0178324, 0.0554642}, {8.46753, -0.0407275, 0.0181964, 0.0444832}, {9.37796, -0.0335484, 0.0180575, 0.034407}, {10.0292, -0.011554, 0.0175209, 0.0288412}, {9.97201, 0.0149599, 0.0176138, 0.0292761}, {9.26241, 0.0356178, 0.0180726, 0.0355339}, {8.35143, 0.0398313, 0.0182203, 0.0459985}, {7.65961, 0.0197696, 0.0177198, 0.0565664}, {7.64906, -0.0188492, 0.0176759, 0.0567545}, {8.32846, -0.0397787, 0.0182334, 0.0463026}, {9.24173, -0.0358937, 0.0180708, 0.0357409}, {9.95964, -0.0156694, 0.0176298, 0.0293723}, {10.0377, 0.0109591, 0.0175124, 0.0287759}, {9.40174, 0.0330543, 0.0180387, 0.0341839}, {8.48915, 0.0409579, 0.0182117, 0.0442026}, {7.73727, 0.0241849, 0.0178219, 0.0552382}, {7.59568, -0.0124666, 0.0176555, 0.0576919}, {8.19157, -0.0385281, 0.0181157, 0.0482101}, {9.09543, -0.0378451, 0.0181881, 0.037209}, {9.88343, -0.0196195, 0.0176451, 0.0299955}, {10.0748, 0.00669031, 0.0175258, 0.0284777}, {9.53747, 0.0302976, 0.0179039, 0.0329489}, {8.63682, 0.0408987, 0.0182775, 0.0423549}, {7.82764, 0.0292861, 0.0178643, 0.0537447}, {7.56057, -0.00703789, 0.0175983, 0.0583216}, {8.06647, -0.0358207, 0.0180966, 0.0500233}, {8.9467, -0.039485, 0.0181878, 0.0388032}, {9.78145, -0.0232511, 0.017775, 0.0308207}, {10.1017, 0.00236988, 0.0174543, 0.0282859}, {9.65618, 0.0271479, 0.0178754, 0.0318854}, {8.78324, 0.0405125, 0.0182071, 0.0406387}, {7.93499, 0.0325832, 0.0180252, 0.0520243}, {7.54824, -0.0000442023, 0.0175562, 0.0585485}, {7.94572, -0.0334643, 0.017989, 0.0518607}, {8.80187, -0.0403039, 0.0182495, 0.0404144}, {9.67295, -0.0268414, 0.0178196, 0.031752}, {10.0984, -0.0018569, 0.0174989, 0.028299}, {9.77464, 0.0236678, 0.0177342, 0.03089}, {8.93014, 0.0396015, 0.0182443, 0.0389711}, {8.05114, 0.0358628, 0.0180266, 0.0502602}, {7.55884, 0.00575207, 0.0176295, 0.0583497}, {7.84062, -0.0291391, 0.0178966, 0.0535344}, {8.64986, -0.0411183, 0.0182456, 0.0422032}, {9.55038, -0.0298543, 0.0179309, 0.0328231}, {10.0821, -0.00630135, 0.0174819, 0.0284324}, {9.86787, 0.0200765, 0.0177021, 0.0301097}, {9.08127, 0.0379811, 0.0181397, 0.0373703}, {8.17784, 0.0381709, 0.0181782, 0.0483934}, {7.58967, 0.0122673, 0.0175886, 0.0578049}, {7.74555, -0.0253178, 0.017841, 0.0550941}, {8.50919, -0.0406442, 0.01823, 0.0439468}, {9.41603, -0.0328918, 0.0180078, 0.0340561}, {10.0405, -0.0103431, 0.0175394, 0.028746}, {9.95559, 0.0160477, 0.0175966, 0.0294144}, {9.22069, 0.0362464, 0.0181311, 0.0359365}, {8.31239, 0.0395759, 0.0181616, 0.0465344}, {7.64273, 0.0178979, 0.017746, 0.0568559}, {7.66846, -0.0198968, 0.0176915, 0.0564199}, {8.3644, -0.0403782, 0.0182305, 0.0458203}, {9.28242, -0.0351626, 0.0180699, 0.0353358}, {9.98134, -0.0146464, 0.0175879, 0.0292076}, {10.0192, 0.0121647, 0.0175565, 0.0289112}, {9.36723, 0.0337067, 0.0180227, 0.0345193}, {8.44958, 0.0408518, 0.0182525, 0.0447004}, {7.71373, 0.0230445, 0.0177413, 0.0556432}, {7.60862, -0.0144718, 0.017704, 0.0574566}, {8.23046, -0.0386613, 0.0181318, 0.0476646}, {9.13321, -0.0374784, 0.0181671, 0.0368209}, {9.90687, -0.0184273, 0.0176403, 0.0298024}, {10.0672, 0.00778794, 0.0175129, 0.0285415}, {9.49681, 0.0312015, 0.0179606, 0.0333093}, {8.59698, 0.0407775, 0.0182349, 0.0428515}, {7.80058, 0.0280394, 0.0178982, 0.0541788}, {7.56787, -0.00854641, 0.0175596, 0.0581959}, {8.10011, -0.0368709, 0.0181374, 0.0495194}, {8.992, -0.0389135, 0.0181698, 0.0383148}, {9.80961, -0.0223441, 0.0177485, 0.0305879}, {10.0963, 0.00370696, 0.0174708, 0.0283241}, {9.62589, 0.0279641, 0.0178763, 0.0321547}, {8.73888, 0.0408703, 0.0182451, 0.0411448}, {7.90409, 0.0314723, 0.0179486, 0.0525192}, {7.55009, -0.00194376, 0.017619, 0.0585078}, {7.97904, -0.0340966, 0.0179767, 0.0513535}, {8.84041, -0.0402705, 0.0182631, 0.0399701}, {9.70803, -0.0257687, 0.0177862, 0.0314526}, {10.1003, -0.00076371, 0.0174957, 0.028285}, {9.74163, 0.0247821, 0.01777, 0.0311649}, {8.89172, 0.0397418, 0.0182307, 0.0394015}, {8.01608, 0.0353279, 0.0180431, 0.0507794}, {7.55323, 0.00390545, 0.0175613, 0.0584584}, {7.86937, -0.0303985, 0.0179734, 0.0530624}, {8.69388, -0.0408306, 0.0182132, 0.0416846}, {9.58246, -0.029099, 0.0179278, 0.0325322}, {10.0909, -0.00496728, 0.0174651, 0.0283682}, {9.84224, 0.0210232, 0.0177244, 0.0303184}, {9.03604, 0.0386213, 0.0181645, 0.0378429}, {8.14277, 0.0372661, 0.0181365, 0.0489046}, {7.57861, 0.0107739, 0.0176244, 0.0579963}, {7.77023, -0.026659, 0.0178065, 0.05469}, {8.54864, -0.0408905, 0.0182754, 0.04344}, {9.45813, -0.032028, 0.0179536, 0.0336724}, {10.0516, -0.00926236, 0.0175471, 0.0286554}, {9.93468, 0.017281, 0.0176026, 0.0295839}, {9.18338, 0.0366911, 0.0181508, 0.0363096}, {8.2721, 0.0395341, 0.0181529, 0.0470824}, {7.62652, 0.0159843, 0.0176919, 0.0571463}, {7.68916, -0.0211693, 0.0177721, 0.0560563}, {8.40347, -0.0405737, 0.0181919, 0.0453135}, {9.3181, -0.0345909, 0.0180868, 0.0349801}, {10.003, -0.0134506, 0.0175426, 0.0290455}, {10.0007, 0.0132084, 0.0175933, 0.0290494}, {9.3273, 0.034511, 0.0180287, 0.0349055}, {8.41293, 0.0403761, 0.0182537, 0.0451783}, {7.69123, 0.0220784, 0.0177268, 0.0560244}, {7.6224, -0.01641, 0.0176725, 0.0572181}, {8.2684, -0.0390428, 0.018196, 0.0471278}, {9.17563, -0.0368996, 0.01811, 0.0363994}, {9.92611, -0.0173775, 0.0176551, 0.0296397}, {10.0589, 0.00902879, 0.0174934, 0.0286122}, {9.45987, 0.031909, 0.0180088, 0.0336413}, {8.55442, 0.0409577, 0.0182091, 0.0433824}, {7.77612, 0.0263763, 0.0178849, 0.0545842}, {7.5775, -0.00981392, 0.0176006, 0.0580204}, {8.13373, -0.0377154, 0.0181098, 0.0490354}, {9.0321, -0.0385041, 0.0181955, 0.0378772}, {9.84051, -0.0213428, 0.0176896, 0.0303426}, {10.0875, 0.00485305, 0.0175091, 0.0283821}, {9.59459, 0.0288805, 0.0178666, 0.0324387}, {8.70031, 0.0408954, 0.0182801, 0.041592}, {7.8735, 0.0308572, 0.0178924, 0.0530078}, {7.55278, -0.00413675, 0.0176174, 0.0584594}, {8.01265, -0.0345756, 0.0180351, 0.0508367}, {8.87976, -0.0400701, 0.0182222, 0.0395365}, {9.73575, -0.0247818, 0.0177974, 0.0312082}, {10.1037, 0.000404529, 0.017462, 0.0282681}, {9.70741, 0.0257125, 0.0178305, 0.0314463}, {8.85054, 0.0400439, 0.0182007, 0.0398714}, {7.98484, 0.0342259, 0.018066, 0.05125}, {7.54967, 0.00260171, 0.0175374, 0.0585248}, {7.89723, -0.0318542, 0.0179792, 0.0526183}, {8.73689, -0.0405465, 0.0182357, 0.0411721}, {9.6179, -0.0283011, 0.0178762, 0.0322267}, {10.0936, -0.0037229, 0.0174906, 0.028339}, {9.81911, 0.0220248, 0.0177105, 0.0305174}, {8.99396, 0.0390727, 0.0182181, 0.0382809}, {8.10673, 0.0367682, 0.018067, 0.0494374}, {7.57015, 0.00870707, 0.0176553, 0.0581439}, {7.79708, -0.0274405, 0.0178311, 0.0542481}, {8.58597, -0.0411562, 0.0182658, 0.0429775}, {9.49522, -0.0311403, 0.0179489, 0.0333268}, {10.0653, -0.00818451, 0.0175124, 0.0285567}, {9.9081, 0.0184194, 0.0176538, 0.0297887}, {9.14598, 0.0371516, 0.0181292, 0.0366989}, {8.23493, 0.0391136, 0.0181895, 0.0475882}, {7.6107, 0.0146287, 0.0176181, 0.0574313}, {7.70983, -0.022969, 0.0178212, 0.0556972}, {8.44552, -0.0404737, 0.0182, 0.0447667}, {9.35475, -0.0340246, 0.0180605, 0.0346303}, {10.0186, -0.0121791, 0.0175434, 0.0289198}, {9.98509, 0.0142645, 0.0175867, 0.0291775}, {9.28375, 0.0352782, 0.0180832, 0.0353193}, {8.37409, 0.0399832, 0.0181996, 0.0457015}, {7.67124, 0.0205065, 0.0177651, 0.0563608}, {7.63919, -0.0177367, 0.0176493, 0.0569295}, {8.30484, -0.0397526, 0.0182276, 0.0466215}, {9.21979, -0.0361613, 0.018085, 0.0359576}, {9.94802, -0.0163816, 0.0176319, 0.0294665}, {10.0443, 0.0103314, 0.0175182, 0.0287212}, {9.42591, 0.0325674, 0.0180072, 0.0339621}, {8.51184, 0.0410886, 0.01824, 0.0439082}, {7.75099, 0.0249937, 0.0178037, 0.0550121}, {7.5887, -0.0116413, 0.0176731, 0.0578125}, {8.17142, -0.0380296, 0.0180955, 0.0485007}, {9.06986, -0.0382154, 0.0182013, 0.0374744}, {9.86897, -0.0201614, 0.0176596, 0.030112}, {10.0804, 0.0059379, 0.0175143, 0.0284365}, {9.5559, 0.0298747, 0.017904, 0.0327803}, {8.66156, 0.0407608, 0.0182578, 0.0420615}, {7.84363, 0.0299864, 0.0179094, 0.0534802}, {7.55691, -0.0059748, 0.0175613, 0.0583917}, {8.04624, -0.0355449, 0.0181046, 0.0503207}, {8.92492, -0.0395785, 0.0181824, 0.0390446}, {9.76338, -0.02389, 0.0177934, 0.0309709}, {10.1032, 0.00175199, 0.0174537, 0.0282746}, {9.67651, 0.0265499, 0.0178543, 0.031711}, {8.80522, 0.0405064, 0.0182173, 0.0403827}, {7.95349, 0.0329878, 0.0180156, 0.0517409}, {7.54858, 0.00100615, 0.01759, 0.0585384}, {7.92798, -0.0328422, 0.0179472, 0.0521429}, {8.77656, -0.0405246, 0.0182702, 0.0407008}, {9.65587, -0.0273115, 0.0178216, 0.0319024}, {10.0962, -0.00261926, 0.0175058, 0.0283148}, {9.79093, 0.0231616, 0.0177207, 0.0307544}, {8.95597, 0.0392918, 0.0182317, 0.038691}, {8.07019, 0.0364692, 0.0180523, 0.0499725}, {7.56236, 0.00664639, 0.0176045, 0.0582899}, {7.82456, -0.0284723, 0.0179136, 0.0537906}, {8.62709, -0.0410695, 0.0182222, 0.0424848}, {9.52746, -0.030392, 0.0179617, 0.0330253}, {10.0783, -0.00693537, 0.0174751, 0.0284646}, {9.88232, 0.0193938, 0.0176965, 0.0299907}, {9.10338, 0.037792, 0.0181296, 0.037141}, {8.20021, 0.0382871, 0.0181837, 0.0480778}, {7.59665, 0.0134276, 0.0176169, 0.0576775}, {7.73138, -0.0246454, 0.0177933, 0.0553372}, {8.48563, -0.0406143, 0.0182524, 0.0442407}, {9.39593, -0.0332893, 0.0179996, 0.03425}, {10.0305, -0.0110647, 0.0175627, 0.0288191}, {9.9688, 0.0154505, 0.0175732, 0.0293134}, {9.24516, 0.0358242, 0.0181279, 0.0356915}, {8.33373, 0.0399565, 0.0181629, 0.0462453}, {7.65361, 0.018568, 0.0177503, 0.0566681}, {7.65771, -0.0188289, 0.0177053, 0.0566038}, {8.34113, -0.0402355, 0.0181962, 0.0461376}, {9.25754, -0.0355594, 0.0181035, 0.0355741}, {9.97189, -0.0153007, 0.0175786, 0.0292868}, {10.0269, 0.0114372, 0.0175648, 0.0288471}, {9.39015, 0.0333306, 0.0179953, 0.0343063}, {8.47451, 0.0408173, 0.0182698, 0.0443773}, {7.72659, 0.0241205, 0.01775, 0.0554247}, {7.60006, -0.0137321, 0.0176751, 0.0576104}, {8.2091, -0.0382685, 0.0181469, 0.047961}, {9.10951, -0.0377936, 0.018155, 0.0370703}, {9.89043, -0.0190636, 0.0176728, 0.0299297}, {10.075, 0.00709948, 0.0174884, 0.0284862}, {9.51743, 0.0306895, 0.0179654, 0.033117}, {8.62027, 0.0408487, 0.018217, 0.0425704}, {7.81732, 0.0285162, 0.0179304, 0.0539031}, {7.56351, -0.00725336, 0.0175587, 0.0582743}, {8.07845, -0.0366384, 0.0181055, 0.049841}, {8.96783, -0.0391035, 0.0181948, 0.038571}, {9.79435, -0.0229781, 0.0177429, 0.0307193}, {10.097, 0.00299567, 0.0174875, 0.0283136}, {9.64779, 0.027431, 0.017841, 0.0319688}, {8.76383, 0.0407433, 0.0182654, 0.0408488}, {7.92171, 0.032237, 0.0179385, 0.0522442}, {7.54918, -0.00113184, 0.017627, 0.058523}, {7.96073, -0.0333401, 0.0179739, 0.0516356}, {8.81458, -0.0404939, 0.0182541, 0.0402663}, {9.68795, -0.0262838, 0.0178162, 0.0316204}, {10.1011, -0.0015111, 0.0174794, 0.0282839}, {9.75736, 0.0242112, 0.017777, 0.0310272}, {8.91667, 0.0395333, 0.0182022, 0.0391312}, {8.03634, 0.0356951, 0.0180863, 0.0504688}, {7.55573, 0.00515397, 0.0175444, 0.0584153}, {7.85164, -0.0299934, 0.0179592, 0.0533455}, {8.67131, -0.0407612, 0.0182208, 0.0419529}, {9.5618, -0.029661, 0.0179321, 0.0327189}, {10.0853, -0.00561561, 0.017483, 0.0284072}, {9.85972, 0.0203758, 0.0176938, 0.0301799}, {9.05864, 0.0384012, 0.0181792, 0.0375988}, {8.16369, 0.037612, 0.0181181, 0.0486085}, {7.58524, 0.0116153, 0.0176635, 0.0578741}, {7.75626, -0.025695, 0.0177804, 0.0549259}, {8.52359, -0.0409962, 0.0182747, 0.043753}, {9.43729, -0.0323998, 0.0179703, 0.0338642}, {10.0448, -0.0100089, 0.0175455, 0.02871}, {9.9457, 0.0166893, 0.0176053, 0.0294929}, {9.20866, 0.0362916, 0.0181213, 0.0360605}, {8.29374, 0.0398232, 0.0181878, 0.0467791}, {7.6357, 0.0169544, 0.0176702, 0.0569888}, {7.67717, -0.0204788, 0.0177824, 0.0562587}, {8.38214, -0.0402665, 0.0181768, 0.0455983}, {9.2937, -0.0350525, 0.018103, 0.0352157}, {9.99254, -0.0140344, 0.0175544, 0.0291263}, {10.0114, 0.012485, 0.0175772, 0.0289679}, {9.34747, 0.0341876, 0.018031, 0.0347087}, {8.43642, 0.0403794, 0.0182378, 0.0448768}, {7.70351, 0.0229257, 0.0177725, 0.0558096}, {7.61368, -0.0154218, 0.0176309, 0.0573762}, {8.24603, -0.0389388, 0.0182061, 0.0474333}, {9.15452, -0.0371262, 0.0181087, 0.0366163}, {9.91215, -0.018071, 0.0176707, 0.0297505}, {10.0654, 0.00842423, 0.0174883, 0.0285626}, {9.48294, 0.0313845, 0.0179876, 0.033431}, {8.57628, 0.0411142, 0.0182245, 0.0431069}, {7.79125, 0.026969, 0.0178738, 0.0543384}, {7.57232, -0.00880837, 0.0176273, 0.0581095}, {8.11366, -0.0372635, 0.0180727, 0.0493331}, {9.00652, -0.0388353, 0.01822, 0.0381452}, {9.8264, -0.0218819, 0.0176912, 0.0304611}, {10.0906, 0.00409201, 0.017511, 0.0283575}, {9.61351, 0.0284457, 0.017853, 0.0322722}, {8.72587, 0.0406951, 0.0182722, 0.0412924}, {7.89004, 0.0316523, 0.0179221, 0.0527404}, {7.55055, -0.00322222, 0.0175827, 0.0585037}, {7.99351, -0.0341126, 0.018052, 0.0511231}, {8.85707, -0.0401679, 0.0182048, 0.0397961}, {9.71565, -0.0253891, 0.0178275, 0.031375}, {10.105, -0.000236737, 0.0174506, 0.0282615}, {9.72579, 0.0250906, 0.017823, 0.031288}, {8.87293, 0.039996, 0.0181943, 0.0396204}, {8.00481, 0.034504, 0.018074, 0.0509476}, {7.55145, 0.00381929, 0.0175622, 0.0584898}, {7.87947, -0.0313311, 0.017932, 0.0529055}, {8.71228, -0.0406702, 0.0182615, 0.0414557}, {9.60005, -0.028794, 0.0178697, 0.0323889}, {10.0889, -0.00446982, 0.017509, 0.0283711}, {9.83628, 0.0214747, 0.0176843, 0.0303796}, {9.0196, 0.0387512, 0.018219, 0.0380048}, {8.12661, 0.0373602, 0.0180723, 0.0491466}, {7.57563, 0.00949099, 0.0176502, 0.0580475}, {7.7821, -0.02655, 0.0178439, 0.0544926}, {8.56171, -0.0411551, 0.0182387, 0.0432839}, {9.47154, -0.0316255, 0.0179843, 0.0335383}, {10.0605, -0.00886963, 0.0174997, 0.028598}, {9.92042, 0.0177322, 0.017659, 0.0296855}, {9.16963, 0.0368821, 0.0181044, 0.0364623}, {8.25829, 0.0392136, 0.0182128, 0.0472615}, {7.61905, 0.015849, 0.0176264, 0.0572832}, {7.69634, -0.0223565, 0.0177858, 0.0559296}, {8.42277, -0.0402849, 0.0182181, 0.0450585}, {9.33271, -0.0344486, 0.0180522, 0.0348467}, {10.0067, -0.0128579, 0.0175719, 0.0290071}, {9.99797, 0.0136069, 0.0175576, 0.0290816}, {9.30663, 0.0348632, 0.0180903, 0.0350918}, {8.39642, 0.0402439, 0.018185, 0.0454092}, {7.68376, 0.0211359, 0.0177939, 0.056144}, {7.62976, -0.0165429, 0.0176465, 0.0570946}, {8.28112, -0.0396645, 0.0182012, 0.0469489}, {9.19579, -0.0364728, 0.0181133, 0.0361932}, {9.93688, -0.0170713, 0.0176244, 0.0295598}, {10.0502, 0.00963558, 0.0175306, 0.028671}, {9.44978, 0.0321132, 0.0179724, 0.0337457}, {8.53634, 0.0410942, 0.0182672, 0.043594}, {7.7651, 0.0259641, 0.0177944, 0.0547784}, {7.58186, -0.0108875, 0.0176694, 0.0579336}, {8.15099, -0.0374924, 0.018096, 0.0487934}, {9.04459, -0.0385502, 0.0181976, 0.0377431}, {9.85218, -0.0207363, 0.017688, 0.0302447}, {10.0865, 0.00520214, 0.0174929, 0.0283942}, {9.57456, 0.0293859, 0.0179116, 0.0326084}} 
$\endgroup$
2
  • 1
    $\begingroup$ You will get better--and quicker--help if you make DATA available. Instead of Hue[ 1 - #] you could try Hue[2 (1-#)/3] , or try ColorData["DarkRainbow"][#] $\endgroup$ Commented Aug 20 at 16:52
  • $\begingroup$ I have provided data. I have tried what you are suggesting, but I'm getting only one color with this. $\endgroup$ Commented Aug 20 at 17:06

1 Answer 1

4
$\begingroup$

Changes:

VertexColors -> Hue /@ Rescale[xdata[[All, 4]], MinMax@xdata[[All, 4]], {0, 2/3}]

and

BarLegend[{Hue[Rescale[#, MinMax@xdata[[All, 4]], {0, 2/3}]] &, MinMax@xdata[[All, 4]]}, LegendLabel -> Style[Superscript["P", "\[Phi]"], 15]]

Legended[Graphics3D[{PointSize[0.006], Point[xdata[[All, 1 ;; 3]], VertexColors -> Hue /@ Rescale[xdata[[All, 4]], MinMax@xdata[[All, 4]], {0, 2/3}]]}, Axes -> True, Lighting -> "Neutral", Background -> White, BoxRatios -> {1, 1, 1/GoldenRatio}, ImageSize -> 400, AxesLabel -> {"r", "\!\(\*SuperscriptBox[\(P\), \(r\)]\)", "\!\(\*SuperscriptBox[\(P\), \(\[Theta]\)]\)"}, BaseStyle -> 15], BarLegend[{Hue[Rescale[#, MinMax@xdata[[All, 4]], {0, 2/3}]] &, MinMax@xdata[[All, 4]]}, LegendLabel -> Style[Superscript["P", "\[Phi]"], 15]]] 

enter image description here

Or using predefined gradients - change "Rainbow" to your favorite gradient.

Legended[Graphics3D[{PointSize[0.006], Point[xdata[[All, 1 ;; 3]], VertexColors -> ColorData["Rainbow", "ColorFunction"] /@ Rescale[xdata[[All, 4]], MinMax@xdata[[All, 4]]]]}, Axes -> True, Lighting -> "Neutral", Background -> White, BoxRatios -> {1, 1, 1/GoldenRatio}, ImageSize -> 400, AxesLabel -> {"r", "\!\(\*SuperscriptBox[\(P\), \(r\)]\)", "\!\(\*SuperscriptBox[\(P\), \(\[Theta]\)]\)"}, BaseStyle -> 15], BarLegend[{ColorData["Rainbow", "ColorFunction"][ Rescale[#, MinMax@xdata[[All, 4]]]] &, MinMax@xdata[[All, 4]]}, LegendLabel -> Style[Superscript["P", "\[Phi]"], 15]]] 

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks, @azerbajdzan. What could be the other options, instead of Rainbow? $\endgroup$ Commented Aug 20 at 19:47
  • 3
    $\begingroup$ @MMS Evaluate {#, ColorData[#, "Image"]} & /@ ColorData["Gradients"] $\endgroup$ Commented Aug 20 at 19:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.