1
$\begingroup$

I would like to know if it's posible to place the y-axis label roated on the left side without using Frame->True and FrameLabel-> {"txt1", "txt2"}

My command:

BarChart[{{0.123, 0.492}, {2.865, 0.055}, {1.03, 1.084}, {4.282, 0.053}},
   AxesLabel -> {"", Rotate["Value", 90 Degree]}, 
   ChartLabels -> {Placed[{"data1", "data2", "data3", "data4"},
     {{0.5, 0}, {0.8, 1.2}}, Rotate[#, (1.75/7) Pi] &], 
     Placed[{"", ""}, Above]}, 
   LabelingFunction -> (
     Placed[Rotate[#, 0.5 Pi], If[#1 > 0.5, Center, Above]] &),
   ChartLegends -> {"⌀", "σ"}
]

The result: Example1

As you can see the label gets rotated. However, I was unable to place it at 50% vertically. Furthermore I've tried

AxesLabel->{"",Placed[Rotate["Value",0.5 Pi],Center]}

without success.

Using a Frame would be on option, but doing so removes the "grouping" in my BarChart:

.

Example2

According to Placing x-axes label below rather than at end of axes Labeled could be on Option too. But again, I was not able to center the label:

Labeled[bar,Rotate["Values",0.5Pi],{{Center,Left}}]
$\endgroup$
  • 2
    $\begingroup$ It is possible to do Frame->{False,True,False,False},Axes->{True,False},PlotRangePadding->None to keep your x axis and use only the frame on the y-axis. $\endgroup$ – N.J.Evans Jul 23 '15 at 16:30
  • $\begingroup$ Thanks you @N.J.Evans - That's what I was looking for. Is there a way to mark this question as solved without a "real answer"? $\endgroup$ – vigri Jul 23 '15 at 16:44
  • $\begingroup$ Related: (19893) $\endgroup$ – Mr.Wizard Jul 23 '15 at 17:18
7
$\begingroup$

Depending on exactly what you're trying to do, adding Frame->{False,True,False,False},Axes->{True,False},PlotRangePadding->None to keep your x axis and use only the frame on the y-axis should work.

BarChart[{{0.123, 0.492}, {2.865, 0.055}, {1.03, 1.084}, {4.282, 
   0.053}}
 , AxesLabel -> {None, Rotate["Value", 90 Degree]}
 , ChartLabels -> {Placed[{"data1", "data2", "data3", 
     "data4"}, {{0.5, 0}, {0.8, 1.2}}, Rotate[#, (1.75/7) Pi] &], 
   Placed[{"", ""}, Above]}
 , LabelingFunction -> (Placed[Rotate[#, 0.5 Pi], 
     If[#1 > 0.5, Center, Above]] &)
 , ChartLegends -> {"⌀", "σ"}
 , PlotRangePadding -> None
 , Frame -> {False, True, False, False}
 , Axes -> {True, False}
 , FrameLabel -> {None, "y-Axis"}
 ]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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