3
$\begingroup$
Tabla = 1/100 {56, 55, 51, 45, 54, 50, 45, 57, 55, 41, 43, 46, 43, 53,
   56, 53, 52, 61, 52, 54, 56, 46, 61, 43, 54, 52, 53, 50, 50, 50, 
   44, 51, 60, 60, 53, 54, 53, 45, 41, 54, 52, 51, 64, 60, 65, 56, 51,
   53, 54, 48, 52, 48, 61, 54, 58, 49, 46, 50, 48, 58, 46, 49, 47, 
   54, 56, 62, 53, 54, 54, 54, 53, 48, 54, 45, 49, 54, 51, 47, 53, 54,
   53, 45, 48, 49, 57, 56, 55, 59, 56, 55, 46, 45, 54, 53, 52, 47, 
   46, 48, 45, 47};

I have following histograms:

Histogram[Tabla, AxesLabel -> {"tempo (s)", "frequência"}]

Histogram[Tabla, 6, "Probability", AxesOrigin -> {0.706, 0}, 
  AxesLabel -> {None, "frequência relativa"}]

I want to overlay them and get one histogram with 2 axes, one axe to left and other to right.

I try with:

Histogram[Tabla, AxesLabel -> {"tempo (s)", "frequência"}, Axes -> {False, True}, 
  Epilog -> Inset[Histogram[Tabla, 6, "Probability", AxesOrigin -> {0.706, 0}, 
  AxesLabel -> {"tempo (s)", "frequência relativa"}]]]

Help me please.

$\endgroup$
  • $\begingroup$ Show[Histogram[Tabla],Histogram[Tabla,6,"Probability",ChartStyle->Blue] $\endgroup$ – N.J.Evans Jun 21 '16 at 18:10
  • $\begingroup$ If you really want to Overlay them, check Dual Axis Histogram. $\endgroup$ – Karsten 7. Jun 21 '16 at 18:40
4
$\begingroup$

You can get both as one Historam with custom right FrameTicks:

ticks = Join[
   Transpose[{#, ConstantArray[Null, Length@#]}] &@Range[0, 42, 2],
   {#, N@#/Length@Tabla} & /@ Range[0, 40, 10]] /. (0.) -> 0

Histogram[Tabla, Frame -> {{True, True}, {True, False}}, 
 FrameLabel -> {{"frequência", "frequência relativa"}, {"tempo (s)", None}},   
 FrameTicks -> {{Automatic, ticks}, {Automatic, None}}]

Out

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.