I can make my xticklabel
apply \bfseries
, I can make my xlabel
and ylabel
apply \bfseries
. For some reason, I cannot seem to get my yticklabel
to apply this effect. At least when I compare the "1" in my xticklabel
, it is clearly different than that in my yticklabel
.
Fairly related, but happy to split into a 2nd question, is applying the same bold weight to the every node near coord/.append style
. I do believe that these values are generated in mathmode, so I am not surprised I was not successful in applying a standard \bfseries
weight to them. But if someone could provide a solution to that as well, it would be great. I did try, based on zero understanding of the inner workings, to use the etoolbox
package and \robustify\bfseries
without effect.
\documentclass[letterpaper]{article}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{xcolor}
\pagecolor{black}
\usepackage{siunitx}
%This didn't work either
%\usepackage{etoolbox}
%\robustify\bfseries
\sisetup{inter-unit-product={}\cdot{},sticky-per=true,multi-part-units=single,%
separate-uncertainty=true,list-units=single,range-units=single,detect-all,%
detect-weight=true,detect-inline-weight=math}
\DeclareSIUnit\calorie{cal}
\DeclareSIUnit\kcal{\kilo\calorie}
\DeclareSIUnit\kcalpmole{kcal\per\mole}
\definecolor{hoyemagenta}{HTML}{FF3FFF}
\definecolor{hoyegreen}{HTML}{31FF31}
%\usepgfplotslibrary{external}
%\tikzexternalize[shell escape=-enable-write18]
%\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error %
%-interaction=batchmode -jobname "\image" "\texsource" && dvips -o "\image".ps %
%"\image".dvi}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
color=white,
width=450pt,
ybar, bar shift=0pt, bar width=12,
enlarge x limits=0.07,
ylabel={Free Energy Difference (\si{\kcalpmole})},
xlabel={Trapping Product},
label style={color=white,font=\bfseries},
xtick={1,2,3,4,5,6,7,8,9,10,11,12},
every axis/.style={color=white},
ymax=40,
ymin=-110,
% I also tried manually setting the ticks, in hopes that would trigger the change
% ytick={-100,-80,-60,-40,-20,0,20,40},
xtick pos=left,
nodes near coords,
%Here I tried setting \bfseries for my nodes without success
every node near coord/.append style={font=\bfseries,%
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision=2},
nodes near coords align={vertical},
tick label style={font=\bfseries\Large},
% y tick label style={color=white,font=\bfseries},
% I used to just have this x tick label style line below, then I tried the separate y tick label style
% and also the tick label style above that
% x tick label style={anchor=center,yshift=-6pt,color=white,font=\bfseries\large},
symbolic x coords={1,2,3,4,5,6,7,8,9,10,11,12}
]
\addplot[fill=hoyegreen,]
coordinates{
(1,-48.93)
(3,-13.62)
(6,-46.85)
(8,-42.27)
(10,-55.74)};
\addplot[fill=hoyemagenta]
coordinates{
(2,-26.90)
(4,31.78)
(5,-49.25)
(7,-49.71)
(9,-44.14)
(11,-51.07)};
\addplot[fill=yellow]
coordinates{(12,-97.69)};
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
Using
\boldmath
instead of\bfseries
is sufficient for both questions.I would really consider changing the style but it's a matter of taste.