I'm plotting a function that is in a module and depends on three variables with ParametricPlot3D, and I'm using a color function for the surface. I want to add a bar to the side that has the values of the height z next to the colors it's assigning to the surface. The closest I've found to what I want is this command:
PlotLegends ->
BarLegend[{ColorData[{"TemperatureMap", "Reverse"}], {0, 1}}]
However, I don't have the minimum and maximum values of the surface, and I don't know if there's a way to either display the values automatically or find the maximum and minumum values of the plot (I've already tried with FindMaximum and FindMinimum but it doesn't work).