我有一个文档,它由一个主文件和包含在主文件中的多个 section.tex 文件组成。这些部分包含作为单独 tex 的图形和表格。
表格和图形直接来自我的 Python 代码,所以我想知道是否有办法通过主文件的序言全局更改 PGFPlots 轴样式?
我用科学数字表示的是这张图片中的 y 轴
我希望更改默认值并跳过 y 轴和 x 轴的科学数字,就像这里一样
上面的这些图片不是来自我的代码,而是来自另一个示例。
这是我的 TABLE.tex 文件的最小示例,但我不想编辑此文件,因为它直接来自 Python 脚本。
% This file was created with tikzplotlib v0.10.1.
\begin{tikzpicture}
\definecolor{darkslategray38}{RGB}{38,38,38}
\definecolor{lavender234234242}{RGB}{234,234,242}
\definecolor{steelblue31119180}{RGB}{31,119,180}
\begin{axis}[
axis background/.style={fill=lavender234234242},
axis line style={white},
tick align=outside,
x grid style={white},
xlabel=\textcolor{darkslategray38}{year},
xmajorgrids,
xmajorticks=false,
xmin=1914.85, xmax=2006.15,
xtick style={color=darkslategray38},
y grid style={white},
ylabel=\textcolor{darkslategray38}{pop},
ymajorgrids,
ymajorticks=false,
ymin=71097.9889446721, ymax=239041.908801229,
ytick style={color=darkslategray38}
]
\path [draw=steelblue31119180, fill=steelblue31119180, opacity=0.2]
(axis cs:1919,139896.179713115)
--(axis cs:1919,78731.8034836065)
--(axis cs:1925,84035.2299180328)
--cycle;
\addplot [semithick, steelblue31119180]
table {%
1919 104781.131147541
1925 114831.262295082
};
\end{axis}
\end{tikzpicture}
然后有这些 section.tex 文件
\section{Working with the Data}
In Figure \ref{fig:pop_g} we can observe the population growth for Germany during the sample period
\begin{figure}[H]
\input{figs/pop.tex}
\centering
\caption{Population Growth}
\label{fig:pop_g}
\end{figure}
最后,我有这个 main.tex 文件,用于运行整个节目,我想在其中进行全局设置。
%! Author = Rick Garmin
%! Date = 12.5.2023
\documentclass[11pt]{article}
\usepackage{amsmath, amssymb, amscd, amsthm, amsfonts}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{appendix}
\usepackage{longtable}
%for plots
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\pgfplotsset{width=10cm} % bigger plot
\pgfplotsset{tick label style={font=\tiny}, label style={font=\scriptsize}, legend style={font=\tiny}}
\DeclareUnicodeCharacter{2212}{−}
\usepgfplotslibrary{groupplots,dateplot}
\usetikzlibrary{patterns,shapes.arrows}
\pgfplotsset{compat=newest}
\usepackage{caption}
\captionsetup[table]{format=plain, font=small, labelfont=bf}
\usepackage{float}
\usepackage{colortbl}
\usepackage{natbib}
\usepackage{geometry}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\usepackage{pdflscape}
\listfiles
\oddsidemargin 0pt
\evensidemargin 0pt
\marginparwidth 40pt
\marginparsep 10pt
\topmargin -20pt
\headsep 10pt
\textheight 8.7in
\textwidth 6.65in
\linespread{1.2}
\title{Economics - Term Paper}
\author{Rick Garmin}
\date{\today}
\begin{document}
\maketitle
\include{sections/q1}
\include{sections/q2}
%\bibliographystyle{apalike}
%\bibliography{bib}
\end{document}