我想让所有符号、数字、字母等与文档其余部分的字体相匹配。目前,X 轴和标题的字体正确。但 y 轴和“弦附近节点”的数字却不正确。我该怎么做?
这就是我的代码目前的样子: https://gyazo.com/05ab769479252a77e78360ea037ad70d
这是我的代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pdflscape}
\usepackage[table]{xcolor}
\usepackage[landscape, a4paper, bottom=0.0in, margin=0in]{geometry}
\usepackage{pgfplots}
\usepackage{array}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[T1]{fontenc}
%Customization
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\pgfplotsset{compat=newest} % Allows to place the legend below plot
\usepgfplotslibrary{
units, % Allows to enter the units nicely
groupplots
}
\pagenumbering{gobble}
\renewcommand{\familydefault}{\sfdefault}
\definecolor{customgreen}{RGB}{21,155,151}
\definecolor{custompink}{RGB}{230,55,148}
\definecolor{customlightblue}{RGB}{207,210,235}
\definecolor{customlighterblue}{RGB}{232,234,245}
\definecolor{custombrown}{RGB}{194,181,155}
\title{test}
\author{sinasohi}
\date{January 2017}
\begin{document}
%\maketitle
\include{Page1}
\include{Page2}
\include{Page3}
\include{Page4}
\include{Page5}
\end{document}
第3页代码:
\pgfplotstableread[row sep=\\,col sep=&]{
interval & a & b \\
K74 & 32.9 & 27.5 \\
K76 & 23.5 & 22.5 \\
K75 & 25.7 & 25.0 \\
K77 & 22.3 & 30 \\
K89-90 & 30.6 & 30 \\
K92 & 19.3 & 15 \\
}\mydata
\pgfplotstableread[row sep=\\,col sep=&]{
interval & a & b \\
K78 & 18.8 & 20 \\
K85, K86, K87 & 66.3 & 60 \\
}\yourdata
\begin{figure}
\centering
\begin{tikzpicture}
\begin{groupplot}[
group style={group size=2 by 1},
legend style={at={(0.5,1)}, text width=6em, text height=1.5ex, anchor=north,legend columns=-1},
ybar,
/tikz/bar width=.6cm,
xtick=data,
ymin=0, %ymax=40,
,height=10cm,
nodes near coords,
every node near coord/.append style={color=black, font=\footnotesize}
]
\nextgroupplot[
title=\textbf{Kardiovaskulære diagnoser},
width=.55\textwidth,
symbolic x coords={K74,K76,K75,K77,K89-90,K92},
ymax=40
]
\addplot[red!20!customgreen,fill=customgreen!80!white] table[x=interval,y=a]{\mydata};
\addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{\mydata};
\legend{Klinik 12345, Landsrapport}
\nextgroupplot[
symbolic x coords={K78, {K85, K86, K87}},
width=.3\textwidth,
enlarge x limits=0.7,
title=\textbf{Yderligere diagnoser},
ymax=80,
/tikz/bar width=.7cm,
]
\addplot[red!20!customgreen,fill=customgreen!80!white] table[x=interval,y=a]{\yourdata};
\addplot[red!20!custompink,fill=custompink!80!white] table[x=interval,y=b]{\yourdata};
\legend{Klinik 12345, Landsrapport}
\end{groupplot}
\end{tikzpicture}
\end{figure}
答案1
问题是
\renewcommand{\familydefault}{\sfdefault}
不会更改数学模式使用的字体。使用例如(除上述行之外)
\usepackage[cm]{sfmath}
有关进一步的解决方案,请参阅用无衬线字体排版数学符号吗?。