Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have used Placed[Before] to place labels on the labels before the bars, but when I specify a plot range, the labels disappear. I need a solution wherein I can use PlotRange and Placed[Before] without the labels disappearing.

share|improve this question
2  
Please edit your post by inserting a image of a plot that shows your problem. Also, include the Mathematica code that produced the plot. This will help others to help you. –  m_goldberg Dec 14 '12 at 17:29
    
@m_goldberg do they have enough rep for that? –  cormullion Dec 14 '12 at 18:33
    
@cormullion No, but they can give URL to image that someone with higher rep can edit to display inline. Very odd restriction in the first place in my opinion. m_goldberg: I think you needed higher rep :) –  ssch Dec 14 '12 at 19:23
    
@cormullion. That slipped my mind. If it hadn't, I would have only asked for code. –  m_goldberg Dec 15 '12 at 1:28
add comment

1 Answer 1

You need to change setting of the option ImagePadding. With default setting for ImagePadding, labels are cut out:

 BarChart[{1, 2, 3}, 
 ChartLabels -> Placed[{"label1", "label2", "label3"}, Before], 
    BarOrigin -> Left, Ticks -> None, PlotRange -> {{0, 3}, All}]

enter image description here

 BarChart[{1, 2, 3}, 
  ChartLabels -> Placed[{"label1", "label2", "label3"}, Before], 
  BarOrigin -> Left, Ticks -> None, PlotRange -> {{0, 3}, All}, 
  ImagePadding -> 30]

enter image description here

If you wish, you can pad only the side you need by setting the padding values for other sides to Automatic:

 BarChart[{1, 2, 3}, 
   ChartLabels -> Placed[{"label1", "label2", "label3"}, Before], 
   BarOrigin -> Left, Ticks -> None, PlotRange -> {{0, 3}, All}, 
   ImagePadding -> {{30, Automatic}, {Automatic, Automatic}}]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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