I used these instructions to make a legend bar next to my plot (I can't comment there)
But I'm lost to where and how can I add FindDivisions to the DensityPlot under "Edit: illustrating additional options"?
{densityPlot, densityColors, densityRange} =
reportColorRange[
ListStreamDensityPlot[data, VectorScale -> Small,
DataRange -> {{0, 2 Pi}, {-0.5, 0.5}},
ColorFunction -> ColorData["Rainbow"]]];
With[{plotWidth = .85, aspectRatio = .9},
density =
display[{densityPlot // at[{0, 0}, plotWidth],
colorLegend[densityColors, densityRange, LabelStyle -> LightGray,
FrameStyle -> Orange, "ColorBarFrameStyle" -> LightGray,
Background -> Darker@Darker@Darker@Blue, "ColorSwathes" -> None,
Contours -> 10, RoundingRadius -> 0, BoxFrame -> 3,
"Digits" -> 2] //
at[{plotWidth, 0}, {1 - plotWidth, plotWidth/aspectRatio}]},
AspectRatio -> aspectRatio, ImageSize -> 400]]
Also how can I add another plot to the existing one? I would need to draw a sinusoid on it. Show command ruins it. It's obvious where sinusoid should be.
This is my plot:
I would like my numbers in a bar legend rounded.
Thanks in advance.
P.S. Just in case you need data I used for my plot.
a = 0.05
z = -1
data =
Table[With[{x = 0 + 2 Pi/5 (i - 1),
y = -0.5 + 0.2 (j - 1)}, {{NIntegrate[
a*z*Cos[t]/((t^2 - 2 t x + x^2 + y^2 + z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 20],
NIntegrate[-z/((t^2 - 2 t x + x^2 + y^2 + z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 20]},
NIntegrate[(y +
a*(t*Cos[t] - x*Cos[t] - Sin[t]))/((t^2 - 2 t x + x^2 + y^2 +
z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 40]}], {i, 1, 6}, {j, 1, 6}]
FindDivisions
. Also, a possible dupe of: mathematica.stackexchange.com/q/6108/5 $\endgroup$