1
$\begingroup$

I have data that represents the binding energy of oxygen on different surfaces. Each bar is a different transition metal, and the length of the bar is the binding energy of oxygen. How do I make the font size of the labels larger while still keeping them centered on the bars?

The way I have it right now, the chart works when it is large enough. When it is too small, the font overlaps and does not look good?

newElementsSmall = {"Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", 
"Cu", "Zn", "Zr", "Nb", "Tc", "Ru", "Rh", "Pd", "Ag", "Hf", "Ta", 
"Re", "Os", "Ir", "Pt", "Au"}

stackData = {-1.69071, -1.48652, -1.42055, -1.16451, -2.51796, \
-1.81939, -1.04659, -1.14478, -1.2814, -2.13397, -1.30394, -1.29924, \
-1.35072, -1.49208, -0.966458, -1.0429, -1.41273, -1.31235, -2.3501, \
-1.45391, -1.25234, -0.963033, -1.10553, -1.01026}

BarChart[ stackData, ChartLabels -> {Placed[newElementsSmall, Above]},
PlotLabel -> Style["6M1@32Ag", Bold, 50], ChartLegends -> {"eV"} ]

overlap when small No overlap when large

$\endgroup$
4
$\begingroup$

Perhaps:

BarChart[stackData, 
        ChartLabels -> {Placed[Style[#, FontSize->Scaled[.025]]&/@ newElementsSmall, Above]},
        PlotLabel -> Style["6M1@32Ag", Bold, 50], ChartLegends -> {"eV"}]

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ Nice result, +1 $\endgroup$ – ciao Apr 4 '14 at 0:39

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.