Graphics, Figures & TablesPicture not displaying?

Information and discussion about graphics, figures & tables in LaTeX documents.
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Picture not displaying?

Post by bazman »

Hi there,

I am trying to add a jpeg file to my document usign the following but nothing is appearing?

Code: Select all


\begin{figure}
	\centering
		\includegraphics{C:/Documents and Settings/Hugh/My Documents/PhD/vol curve.JPG}
	\label{fig:vol curve}
\end{figure}

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Picture not displaying?

Post by gmedina »

Hi,

avoid blank spaces both in tha path and in the name of your figures. If you really need to use spaces, the grffile package could be of interest to you.

On a side note, I see that you are using a \label command for a figure environment without the corresponding \caption command; this will produce undesired results when referencing the figure. Inside the floating environments (figure, table) the \label command should always appear after the corresponding \caption command.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Re: Picture not displaying?

Post by bazman »

Thanks for this.

I have found friffle onthe web. It's part of the Oberdiek package. How di I install it into TeXnicCenter. The instructions that come with it are aminly for unix machines,

I guess I just need to know where to actually store teh files and then what command to use to add the program. Do I just add griffle or should I add the whole of Oberdiek.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Picture not displaying?

Post by Stefan Kottwitz »

Hi,

I guess you're using MiKTeX. In that case use the MiKTeX package manager, click Start/ MiKTeX/ Browse packages, I recommend to install the complete Oberdiek bundle with MiKTeX.

Stefan
LaTeX.org admin
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Picture not displaying?

Post by bazman »

Hi there,

OK its working kind of:

Code: Select all

\begin{figure}
	\centering
		\includegraphics{\griffle{C:/Documents and Settings/Hugh/My Documents/PhD/vol curve.JPG}}
	\label{fig:vol curve}
\end{figure}
However only the bottom corner of the image appears the rest is off the side of the page. + the image seems too mig and "zoomed in" which makes it look slightly fuzzy?

also gmedina
gmedina wrote:On a side note, I see that you are using a \label command for a figure environment without the corresponding \caption command; this will produce undesired results when referencing the figure. Inside the floating environments (figure, table) the \label command should always appear after the corresponding \caption command.
The code you see was generated automatically by the TeXnicCenter package. I do not have any \caption command to put \label after? can you clarify please?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Picture not displaying?

Post by Stefan Kottwitz »

Hi bazman,

please use the Code button for including TeX code and the Quote button if you refer to another posting like above, I've edited your post to show how it would look like.
Regarding your question I'm sure gmedina will answer it.

Stefan
LaTeX.org admin
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Re: Picture not displaying?

Post by bazman »

Just to add not only is the picture not displaying properly it is sill also outputting the file location as well as the picture?

Hope it helps

Baz
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Picture not displaying?

Post by bazman »

OK I have done some digginf:

I have converted the file to an eps file:

Code: Select all

\begin{figure}[h]
\includegraphics[scale=0.25]{vol curve.eps}
\caption{Diagram showing the wavefunction $\psi\left(x\right)_{1}$ in the left region and $\psi\left(x\right)_{2}$ in the right}
\end{figure}
Is displays but is still shows the file name twice and then displays the image. Obviously I do no want the file name to eppear and it pushes the pitture off to the left.

It seems like I am getting there I just need to know how to stop the file name from appearing and hot to position the eps file better.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Picture not displaying?

Post by Stefan Kottwitz »

Hi,
bazman wrote:

Code: Select all

\includegraphics[scale=0.25]{vol curve.eps}
Is displays but is still shows the file name twice and then displays the image... It seems like I am getting there I just need to know how to stop the file name from appearing
that's usually caused by spaces in the file name or path like mentioned by gmedina, as can be seen in the file name above.

Stefan
LaTeX.org admin
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Picture not displaying?

Post by bazman »

ah that's it!

Unfortunately griffle doesn't seem to work so I renamed the file and now the code below does work:

Code: Select all

\begin{figure}[h]
\centering
\includegraphics[scale=0.25, angle=-1]{volcurve.eps}
\caption{Diagram showing the wavefunction $\psi\left(x\right)_{1}$ in the left region and $\psi\left(x\right)_{2}$ in the right}
\end{figure}
Post Reply