von Stefan Kottwitz » Mo 2. Mär 2026, 14:19
Wie wäre das:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[h!]
\centering
\begin{small}
\begin{tikzpicture}[scale=0.75, transform shape]
\begin{axis}[
ybar,
bar width=2em,
width=18em, height=20em, % Seize of the Plots
xlabel={year},
ylabel={million tons},
symbolic x coords={2023, 2024, 2025, 2026},
xtick={2024, 2025},
ymin=80, ymax=81.8,
ytick={80.2,80.4,80.6,80.8,81.0,81.2,81.4,81.6,81.8},
every node near coord/.append style={font=\small},
enlarge x limits=0.3, %Give some space to the borders
bar shift=0pt
]
\addplot[style=gray, fill=gray] coordinates { (2024,81.0) };
\addplot[style=black,fill=black] coordinates { (2025,81.8) };
\end{axis}
\end{tikzpicture}
\end{small}
\caption{Increased Steal Production}
\label{Fig_Increased_Steal_Production}
\end{figure}
\end{document}
Ich habe xtick geändert und bar shift auf 0 gesetzt.
Stefan
Wie wäre das:
[code]
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[h!]
\centering
\begin{small}
\begin{tikzpicture}[scale=0.75, transform shape]
\begin{axis}[
ybar,
bar width=2em,
width=18em, height=20em, % Seize of the Plots
xlabel={year},
ylabel={million tons},
symbolic x coords={2023, 2024, 2025, 2026},
xtick={2024, 2025},
ymin=80, ymax=81.8,
ytick={80.2,80.4,80.6,80.8,81.0,81.2,81.4,81.6,81.8},
every node near coord/.append style={font=\small},
enlarge x limits=0.3, %Give some space to the borders
bar shift=0pt
]
\addplot[style=gray, fill=gray] coordinates { (2024,81.0) };
\addplot[style=black,fill=black] coordinates { (2025,81.8) };
\end{axis}
\end{tikzpicture}
\end{small}
\caption{Increased Steal Production}
\label{Fig_Increased_Steal_Production}
\end{figure}
\end{document}[/code]
Ich habe xtick geändert und bar shift auf 0 gesetzt.
Stefan