1
$\begingroup$

My data consists of two lists of numbers between -0.1 and 1. I would like to show them on two horizontal histograms, with a thickened x-axis. I have managed to make the first histogram look exactly like I would like:

Histogram[list1, Automatic, "LogCount", BarOrigin -> Left,
  PlotRange -> {-0.1, 1}, Axes -> {True, False}, Frame -> True,
  AxesOrigin -> {0, 0},  AxesStyle -> Thick]

Histogram for the first list

However, when I try to do the same thing for the second list, I get the following result:

Histogram[list2, Automatic, "LogCount", BarOrigin -> Left,
  PlotRange -> {-0.1, 1}, Axes -> {True, False}, Frame -> True,
  AxesOrigin -> {0, 0},  AxesStyle -> Thick]

Histogram for the second list

I am not sure why the histogram does not begin at 0. There are no negative numbers in the list so it should clearly indicate that. I can make the histogram align to the left side:

Histogram[list2, Automatic, "LogCount", BarOrigin -> Left,
  PlotRange -> {-0.1, 1}, Axes -> {True, False}, Frame -> True,
  AxesOrigin -> {0, 8},  AxesStyle -> Thick]

enter image description here

but then the x-axis ticks are mismatched between the two histograms and I would like them to be the same.

How can I have a consistent positioning and frame ticks between the two histograms?

Edit: here's some example data: http://pastebin.com/raw/SzW7uiiy

$\endgroup$

closed as off-topic by MarcoB, user9660, Öskå, ubpdqn, RunnyKine Mar 5 '16 at 20:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – MarcoB, Community, Öskå, ubpdqn, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 0) Browse the common pitfalls question 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Dr. belisarius Feb 25 '16 at 13:44
  • $\begingroup$ I can't reproduce your first plot, is there any way for us to generate equivalent data to reproduce this? $\endgroup$ – Jason B. Feb 25 '16 at 14:46
  • $\begingroup$ @JasonB If you copy and paste the contents of pastebin.com/raw/SzW7uiiy to Mathematica you will see the difference. It's not as extreme as for the full data, but there is still a difference in the x-axis ticks for histograms with the same options. $\endgroup$ – Mereenie Feb 25 '16 at 15:41
  • $\begingroup$ @Mereenie, what version are you using? For me (version 10.3.1), the PlotRange setting you use, has a horrible effect on the plots. I have to use PlotRange -> {{xmin, xmax}, {ymin, ymax}} This is what I get using your settings $\endgroup$ – Jason B. Feb 25 '16 at 15:48
  • $\begingroup$ But trying to manually set the PlotRange I get this abomination $\endgroup$ – Jason B. Feb 25 '16 at 15:50

Browse other questions tagged or ask your own question.