Hi Felipe,
you seem to assume a temperature range like {0, 50}, but this appears not to be the case:
{min, max} = MinMax @ Table[distribution[5, 5, t], {t, 0, 43200, 100}]
(* Out : {-6.039615579447638`, 4.027849921458779`*^7} *)
so I can offer two options (using the above definition of {min, max}): Either your color bar shows the full range of possible temperatures:
Manipulate[
DensityPlot[distribution[x, y, t], {x, 0, 9}, {y, 0, 9}, Mesh -> 9,
FrameLabel -> {"x (cm)", "y (cm)"},
ColorFunction -> (ColorData["TemperatureMap"][
Rescale[#, {min, max}, {0, 1}]] &),
ColorFunctionScaling -> False,
PlotLegends ->
BarLegend[{Automatic, {min, max}}, LegendMarkerSize -> 320,
LegendLabel -> "T (\[Degree]C)"],
PerformanceGoal -> "Quality"], {t, 0, 43200}]
or the color bar shows only the temperature in the plot at a time:
Manipulate[
DensityPlot[distribution[x, y, t], {x, 0, 9}, {y, 0, 9}, Mesh -> 9,
FrameLabel -> {"x (cm)", "y (cm)"},
ColorFunction -> "TemperatureMap", ColorFunctionScaling -> True,
PlotLegends ->
BarLegend[Automatic, LegendMarkerSize -> 320,
LegendLabel -> "T (\[Degree]C)"],
PerformanceGoal -> "Quality"], {t, 0, 43200}]
It depends on what you like better. Note that instead of Animate
I used Manipulate
which I find more flexible, e.g. after pressing that [+]
button one can see the current value of your parameter.
Regards -- Henrik