# How do I make smaller discontinuities, remove tick marks from an axis, and position the axis labels correctly?

I am trying to graph y=e^(1/x) using PGF/TikZ.

I have been unsuccessful in solving the following three problems:

1. I want the axis labels to look nice

I want the y-axis label to be at the top right of the y-axis like in a book

Similarly, I want the x-axis label to be at the bottom right of the x-axis

Currently, they are not in these places, and do not look "nice"

1. I would like to make the discontinuity smaller, so it is more aesthetically pleasing.

2. How do I remove the tick marks on the y-axis?

Below is a short executable example. I removed a lot of the extra packages, but some are present; I didn't feel fully confident going in and making big changes to these parts of the preamble.

Thank you very much for taking the time to help me get past these roadblocks, and for overlooking some of the not-so-minimal parts of the following code.

\documentclass{article}
\usepackage[utf8]{inputenc}

%maths
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

%tikzpicture
\usepackage{tikz}
\usepackage{scalerel}
\usepackage{pict2e}
\usepackage{tkz-euclide}

\usetikzlibrary{calc}
\usetikzlibrary{patterns,arrows.meta}
\usetikzlibrary{external}
\usetikzlibrary{decorations.markings}

%pgfplots
\usepackage{pgfplots}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{fillbetween}

\pgfplotsset{
standard/.style={
axis line style = thick,
enlargelimits,
axis x line=middle,
axis y line=middle,
enlarge x limits=0.15,
enlarge y limits=0.15,
every axis x label/.style={at={(current axis.right of origin)},anchor=north west}
every axis y label/.style={at={(current axis.above origin)},anchor=south east}
grid=both,
ticklabel style={font=\tiny,fill=white}
}
}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
%standard,
xmin=-2, xmax=4,
ymin=-2,ymax=4,
axis lines=middle,
xtick={-1/2},
ytick={},
yticklabels={},
xticklabels={$-\frac{1}{2}$},
%ticks=none,
x label style={at={(ticklabel cs:1)},anchor=north},
y label style={at={(ticklabel cs:1)},rotate=0,anchor=west},
xlabel={$x$},
ylabel={$y$}]
%\clip (-2,-2) rectangle (4,2);
domain=-2:-0.51,
samples=100,
color=black]
{e^(1/x)};
domain=-0.49:-0.1,
samples=100,
color=black]
{e^(1/x)};
domain=0.1:4,
samples=100,
color=black]
{e^(1/x)};
\path[draw,dashed] (-2,1) -- (4,1);
\end{axis}
\end{tikzpicture}
\end{document}

• Welcome to TeX.SE! Oct 1 at 20:11

• your document example is not minimal, in preamble are loaded many unrelated package and defined unrelated commands. In my MWE I remove all of them,
• you have many questions, you should focused to one only ...
• it is not entirely clear, what you after, so I guess, that you looking for something like this:

This figure is produced by the following MWE (Minimal Working Example, a small but complete, compilable document):

\documentclass[border=3.141592]{standalone}

\usepackage{pgfplots}
%\usepgfplotslibrary{statistics}    % not used in this example
%\usepgfplotslibrary{fillbetween}   % not used in this example

\pgfplotsset{compat=1.18}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
ymin=-1, ymax=10,
xtick={-1/2},
ytick=\empty,  % <--- changed
xlabel={$x$},
ylabel={$y$},
tick label style={font=\footnotesize},
label style={below left},
restrict y to domain=-2:100,    % <------ added
samples=200,
every axis plot post/.append style={very thick},
]

• pgfplotstable is not needed Oct 2 at 0:07