Graphics, Figures & TablesSimple reference of graphics

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Simple reference of graphics

Post by thedreamshaper »

I am trying to learn LaTex, and one obviuos feature is the ability to reference graphics, tables and so on. But my code doesnt seem to work and i cant figure out why. I was hoping for some help :)

Code: Select all

\subsection{Residualplot}
Et residualplot skabes ved at plotte ens kovariater(de kontinuerte forklarende variable) eller ens fittede værdier imod ens residualer, dette plot kan så anvendes til visuelt at kontrollere en lang række af de normale og de generaliserede lineære modellers forudsætninger(se modelkontrol afsnit), se evt. figur ~\ref{fig:residualplot1} side \pageref{fig:residualplot1}.


\begin{figure][here]
	\centering
		\includegraphics[scale=0.7,angle=0]{resplots.eps}
	\caption{Figuren viser 6 residualplots, overskrifter forklarer.}
	\label{fig:residualplot1}
\end{figure}
Figur \ref{fig:residualplot1}.


Thanks a bunch :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Simple reference of graphics

Post by frabjous »

Please consult the Post on Avoidable Mistakes and in particular the link to instructions on creating a minimal working example. It should be compiliable on its own (a complete minimal document), not include reference to documents we do not have access to (such as .eps figures that don't come with LaTeX). It would also be wise to elaborate a bit more on what you mean by "doesn't seem to work".

I don't know if this was a typo when posting here but the most obvious problem is that you have:

Code: Select all

\begin{figure][here]
The first ] should be a }, and I do not believe that there is a placement option "here". Try:

Code: Select all

\begin{figure}[h!]
I also don't understand the point of the ~ before the first \ref{fig:residualplot1}: why would you want an extra space there?

Apart from that, I do not see any problems with your snippet. The following works fine for me. (I swapped out resplots.eps for tiger.eps which comes with ghostscript and most LaTeX distributions.) Or is there some other problem I should be aware of?

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\begin{document}
\subsection{Residualplot}
Et residualplot skabes ved at plotte ens kovariater(de kontinuerte forklarende variable) eller ens fittede værdier imod ens residualer, dette plot kan så anvendes til visuelt at kontrollere en lang række af de normale og de generaliserede lineære modellers forudsætninger(se modelkontrol afsnit), se evt. figur \ref{fig:residualplot1} side \pageref{fig:residualplot1}.


\begin{figure}[here]
   \centering
      \includegraphics[scale=0.3,angle=0]{tiger.eps}
   \caption{Figuren viser 6 residualplots, overskrifter forklarer.}
   \label{fig:residualplot1}
\end{figure}
Figur \ref{fig:residualplot1}.
\end{document}
figure.png
figure.png (90.93 KiB) Viewed 2342 times
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Re: Simple reference of graphics

Post by thedreamshaper »

Thank you! :)

It works fine for me now, the ~ symbol was included simply because i didnt/doesnt know what i am doing so i had "stolen" it from a website(learning to code a new language, which i consider latex, is basickly stealing when starting out for me).

Sorry about breaking forum protocol, but i use alot of internet forums(different subjects), and though it seems very rude i simply wont use the time to learn each forums particular set of rules, i simply try to do what seems best/most user friendly. And obviusly your right i should have included a workable document :) ill try to remember next time
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Simple reference of graphics

Post by localghost »

thedreamshaper wrote:[…] Sorry about breaking forum protocol, but i use alot of internet forums(different subjects), and though it seems very rude i simply wont use the time to learn each forums particular set of rules, i simply try to do what seems best/most user friendly. And obviusly your right i should have included a workable document :) ill try to remember next time
Even if you are active in many forums, reading the particular rules is essential because they probably have different demands on behaviour.


Thorsten
Post Reply