0
$\begingroup$

I have plotted a data set using a ListDensityPlot.

    plot1 = ListDensityPlot[Result2, 
  ColorFunction ->(*(*(ColorData[
   "TemperatureMap"][#3]&)*)(*"SunsetColors"*)"Hue"*)
   ColorData["Rainbow"], PlotRange ->(*{{4,8},{0,0.01}}*)All, 
  PlotLegends ->(*{{Blue,Green,Yellow},{10^-4,10^-2,10^0}}*)
   Automatic,(*BarLegend[{"TemperatureMap",{0.0,0.22}}],*)
  FrameTicks -> {{{{0.00, "0.000"}, {0.005, ""}, {0.01, ""}, {0.015, 
       ""}, {0.02, "0.002", {0.01, 0}}, {0.025, ""}, {0.03, 
       ""}, {0.035, ""}, {0.04, "0.004", {0.01, 0}}, {0.045, 
       ""}, {0.05, ""}, {0.055, ""}, {0.06, 
       "0.006", {0.02, 0}}, {0.065, ""}, {0.07, ""}, {0.075, 
       ""}, {0.08, "0.008", {0.01, 0}}, {0.085, ""}, {0.09, 
       ""}, {0.095, ""}, {0.1, "0.010", {0.01, 0}}}, 
     Automatic}, {Automatic, Automatic}}, 
  FrameTicksStyle -> Directive[FontSize -> 18, Bold], 
  FrameLabel -> {Style["Time (ns)", 20, Bold, Black], 
    Style["Space (km)", 20, Bold, Black]}(*,AspectRatio\[Rule]2/3*)]

and the plot looks like

enter image description here

Now I wish to change the colors of the plot manually. I have tried using the different ColorData options but how to choose each of the color individually. It might be easy but I am totally confused.

Please help.

$\endgroup$
4
  • $\begingroup$ You will want to use an explicit ColorFunction in your plot. One way to select custom color e.g. for different ranges of values in your function would be to use a Piecewise function as your color function. $\endgroup$
    – MarcoB
    Jul 27 at 6:05
  • $\begingroup$ Thank you so much. Another point is I am trying to change the label of ticks of the bar legend but the option doesn't exist in 12.1 version. Please suggest an alternative for that. $\endgroup$ Jul 27 at 13:30
  • $\begingroup$ I am not sure that I understand your second request. Can you show the legend you have now, and describe or show how you want it changed? $\endgroup$
    – MarcoB
    Jul 27 at 13:58
  • $\begingroup$ I have this right now. Like on the bar legend I have markings like 0.1,0.2,0.3 etc. which is coming automatically. But now I want to write 10^-1 instead of 0.1, then how can I do it? Actually right now I can't show the legend. $\endgroup$ Jul 27 at 14:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.