3

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}}]
vigri
  • 203
  • 2
  • 6

1 Answers1

9

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

LCarvalho
  • 9,233
  • 4
  • 40
  • 96
N.J.Evans
  • 5,093
  • 19
  • 25