Is Tikx the Solution for Creating Inverse Functions in Overleaf?

Click For Summary
SUMMARY

The discussion focuses on using TikZ in Overleaf to create inverse functions for plotting. The user aims to generate a graph without grid lines, featuring only the axes and a dashed line representing the equation x=y. The provided code snippet utilizes the pgfplots package to achieve this, demonstrating the plotting of both a function and its inverse. The user expresses satisfaction with the example code and plans to implement it in their project.

PREREQUISITES
  • Familiarity with LaTeX typesetting
  • Understanding of TikZ and pgfplots packages
  • Basic knowledge of plotting functions and their inverses
  • Experience using Overleaf for LaTeX document preparation
NEXT STEPS
  • Explore advanced TikZ features for custom graph styling
  • Learn about pgfplots axis configuration options
  • Investigate how to plot multiple functions and their inverses simultaneously
  • Review LaTeX documentation for troubleshooting common errors in TikZ
USEFUL FOR

Mathematicians, educators, and students who need to visualize functions and their inverses using LaTeX in Overleaf.

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
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
6
Views
2K
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
6K
Replies
1
Views
6K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K