0

I am using LaTeX for writing a lab report for my Physics class and I have added a graph to my report as a figure using the following lines:

\begin{figure}[H]
\centering
\includegraphics[scale=0.7]{Lab Report 1/mvsT.png}
\caption{Mass of bob vs Time period of oscillation graph}
\end{figure}

And the final output of the caption is as follows:

Figure 4: Mass of bob vs Time period of oscillation graph

Now I want to change it so that instead of saying 'Figure 4', it says 'Graph 1'. I was wondering if that was possible by using a \begin{figure} command or if I would have to use some other function for this specific case.

For reference, I am a beginner to LaTeX; therefore, it would be really helpful if the responses aren't too technical in nature, thank you.

1 Answers1

1

Yes you can do that using float package and define a new float, here's an attempt :

\documentclass[12pt, a4paper]{book}
\usepackage{float}
\newfloat{Graph}{htbp}{los}[chapter]
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\chapter{Introduction :}
This is a simple graph : 
\begin{Graph}
\begin{center}
\begin{tikzpicture}[>=stealth]
\draw[thick, ->] (0,0)--(5,0);
\draw[thick, ->] (0,0)--(0,5);
\draw[thick, blue, samples=300, variable=\t, domain=0:4] plot (\t, {0.2*\t^2});
\end{tikzpicture}
\end{center}
\caption{This is the graph of $f(x)=\dfrac{1}{5}x^2$ }
\end{Graph}

\end{document}

And here's the result :

enter image description here

As you can see, now you can use this 'environment' and its caption's numbering is thechapter.theGraph, and you can edit this of course, so I encourage you to read the package's documentation here.

euler_med
  • 518
  • Thank you for the response; however, my input is not actually a LaTeX graph itself. I still want to insert a picture (a pitcure of a graph) but the caption, instead of reading "Figure #: [...]", I want it to read "Graph #: [...]", is that possible achieve? – noob anomaly Jun 14 '23 at 06:21