I know the title can be misleading, but I don't know how to put it better. I will correct it when I get better proposals.
I try drawing plots from external tables with pgfplots. Alas, the template I have to use is pretty narrow, thus I have to place multiple steps tightly together.
This means, I define a style for my plots, such that the axis borders are in line with my document \linewidth
.
Unfortunately, I want to use one style for many plots, thus I do not set tick count manually (and don't want to). In the attached example, the ticks are all fine (I do not really care about them, it's for qualitative purposes only) but the outmost ticks stretch my bounding box outside, overlapping in case of two plots placed next to each other.
See the attached image for my problem, problematic parts encircled in red. Blck boxes around are fboxes displaying the image border.
Packages used are
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
My style is defined as follows and applied to the axis environment: (neglecting colour, thickness and other irrelevant parts)
gek1d/.style={
enlargelimits=false,
scale only axis,
xlabel={$x$},
ylabel={$f(x)$},
axis lines=middle,
xtick align=center,
enlarge x limits=false,
x axis line style={-stealth},
width=\linewidth ,
height=0.618\linewidth,
yticklabel style={overlay},
xticklabel style={overlay},
}
So what I want to do is: command the ticks to be only inside the axis. I do not want to set them manually nor move the labels nor delete the labels entirely. This means, I am fine with +-8 being the most outside ticks in this case, I would also be fine with +-9 being the most outside ticks, but I do not want the +-10 ticks in there. Does anyone have any ideas?
axis
environment (so\begin{axis}[xtick=...]
):xtick={-8,-6,...,8},
for the above graph andxtick={-5,0,...,5}
for the one below.