I have two histograms and using listplot to draw both. Now, I want to draw a second plot, below the first, with the ratio of each bin. Does anyone know how to do this?
Many thanks.
This is the code I'm using to draw the histograms:
Needs["PlotLegends`"]
dadosGtop = Import["Gtop_PR.dat", "table"];
costhbGtop = Table[dadosGtop[[i]][[1]], {i, 1, Length[dadosGtop]}];
costhleGtop = Table[dadosGtop[[i]][[2]], {i, 1, Length[dadosGtop]}];
histPlot[data_, bins_, origin_, color_, label_, title_, nome_] :=
Module[{countBorder1 =
Partition[Riffle[Riffle[#1, #1[[2 ;;]]], Riffle[#2, #2]], 2] & @@
HistogramList[data[[1]], bins],
countBorder2 =
Partition[Riffle[Riffle[#1, #1[[2 ;;]]], Riffle[#2, #2]], 2] & @@
HistogramList[data[[2]], bins],
},
ListLinePlot[{countBorder1, countBorder2}, PlotRange -> All,
PlotStyle -> {{color[[1]]}, {color[[2]], Dashed}},
AxesLabel -> {Style[label[[1]], 14, Bold],
Style[label[[2]], 14, Bold]}, AxesOrigin -> origin,
LegendPosition -> {0.65, 0.1}, LegendSize -> 1,
LegendShadow -> None,
PlotLegend -> {Style[nome[[1]], 12, Bold],
Style[nome[[2]], 12, Bold]},
PlotLabel -> Style[title, Black, 14, Bold],
TicksStyle -> {16, Bold}, ImageSize -> Scaled[0.6]]];
histPlot[{costhbGtop, costhneGtop}, {-1, 1, 0.1}, {-1, 0}, {Green, Blue}, {"\[Eta]",
"\!\(\*FractionBox[\(dN\), \(d\[Eta]\)]\)"}, "Pseudorapidity of b", \
{"b", "ne"}]
Here is a data sample:
dadosGtop={
{-0.68, 0.536, 0.316}, {-0.394, 0.187, 0.287}, {-0.874, 0.753, 0.474},
{-0.202, 0.18, 0.066}, {-0.267, 0.894, -0.077}, {0.126, -0.144, -0.063},
{0.952, 0.63, -0.953}, {0.671, 0.073, -0.84}, {-0.344, 0.72, -0.024},
{0.824, -0.205, -0.741}, {0.718, -0.793, -0.268}, {-0.423, 0.568, -0.204},
{-0.192, -0.096, 0.357}, {-0.03, 0.865, -0.629}, {-0.784, 0.39, 0.588},
{0.98, 0.59, -0.953}, {-0.97, 0.682, 0.653}, {-0.654, 0.907, -0.201},
{-0.35, 0.712, -0.176}, {-0.929, 0.654, 0.48}, {-0.479, 0.826, 0.099},
{-0.54, 0.785,-0.724}, {-0.812, 0.818,-0.069}, {-0.988, -0.083, 0.89},
{-0.559, 0.976,-0.188}, {0.748, 0.211,-0.994}, {0.507, -0.527,-0.266},
{0.776, -0.025,-0.964}
}