MHB Is Tikx the Solution for Creating Inverse Functions in Overleaf?

AI Thread Summary
The discussion revolves around creating a simple inverse function plot using TikZ in Overleaf. The user is encountering errors when attempting to cut and paste code for this purpose. They express a desire for a clean plot without a grid, featuring only the x and y axes with ticks where the graph intersects the axes, along with a dashed line representing y=x. The provided code snippet using the pgfplots package is acknowledged as a suitable example, and the user plans to test it further. The conversation highlights the importance of simplicity in visual representation while ensuring the necessary elements are included for clarity.
karush
Gold Member
MHB
Messages
3,240
Reaction score
5
ok I have been trying to cut and paste in packages and code to get a simple inverse function to plot
but nutin shows up and get error message.

if possible I would like no grid but an xy axis with tick only where the graph goes thru the axis
and of course a dashed line of x=y

some of the ones demonstrated in stackexchange had too much decorations

anyway

im using overleaf so fat everything that tikx is used here works there
 
Physics news on Phys.org
Something like this?

\begin{tikzpicture}
%preamble \usepackage{pgfplots}
\begin{axis}[
axis lines=middle,
xmin=-1, xmax=2, ymin=-1, ymax=2
]
\addplot[help lines, dashed] (x, x);
\addplot[blue, smooth, ultra thick] (x, x*x);
\addplot[red, smooth, ultra thick] (x*x, x);
\end{axis}
\end{tikzpicture}

Code:
\begin{tikzpicture}
  %preamble \usepackage{pgfplots}
  \begin{axis}[
      axis lines=middle,
      xmin=-1, xmax=2, ymin=-1, ymax=2
    ]
    \addplot[help lines, dashed] (x, x);
    \addplot[blue, smooth, ultra thick] (x, x*x);
    \addplot[red, smooth, ultra thick] (x*x, x);
  \end{axis}
\end{tikzpicture}
 
Last edited:
That looks like what I want
I try it tomorrow

Mahalo
 
Back
Top