Feinere Darstellung der Diagrammraster

Feinere Darstellung der Diagrammraster

Für das folgende MWE:

\documentclass{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tikz,pgf}


\usepackage{pgfplots}
\usepackage{slashbox}
\usepackage{bchart}


\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols,automata}

\begin{document}

\begin{figure}[H]
\begin{tikzpicture}
\begin{axis}[%
scaled y ticks = true,
width=1*\textwidth,
height=8cm,
xlabel={Query},
ylabel={Elapsed Time (in seconds)},
xmajorgrids,
ymajorgrids,
zmajorgrids,
enlarge x limits=0,
scaled x ticks = true]
\addplot [
color=red,
solid,
line width=1.0pt
]
coordinates{
(0,10)
(1,4)
(2,5)
};
\end{axis}
\end{tikzpicture}
\caption{Blah}
\end{figure}

\end{document}

Wie kann ich die Gitter feinkörniger machen?

Antwort1

Sie müssen den Stil nicht für jedes Achsenraster definieren. grid=majorlegt sie alle auf einmal fest. Sie müssen auch kleine Markierungen einfügen, um ein feineres Raster zu erhalten. Dann können Sie verwenden, was und grid=bothbedeutet . Wenn das Folgende nicht ausreicht, können Sie dasselbe für die Achse oder Option tun .minormajoryminor tick

\documentclass{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
%\usepackage{tikz,pgf} %Pgfplots loads TikZ, and TikZ loads PGF by default



\usepackage{pgfplots}
%================================  You don't need all this for the MWE
\usepackage{slashbox}
\usepackage{bchart}


\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
    matrix,shapes.symbols,automata}
%%=================================
\begin{document}

\begin{figure}[H]
\begin{tikzpicture}
\begin{axis}[%
scaled y ticks = true,
width=\textwidth,
height=8cm,
xlabel={Query},
ylabel={Elapsed Time (in seconds)},
grid=both,
ticks=both,
minor xtick={0,0.1,...,2},
enlarge x limits=0,
scaled x ticks = true
]
\addplot [
color=red,
solid,
line width=1.0pt
]
coordinates{
(0,10)
(1,4)
(2,5)
};
\end{axis}
\end{tikzpicture}
\caption{Blah}
\end{figure}

\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen