Graphics, Figures & TablesLabeling graphs

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kmath
Posts: 7
Joined: Sat Apr 27, 2013 2:54 am

Labeling graphs

Post by kmath »

Dear all,

I have:

Code: Select all

\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz,tikz-3dplot}
\begin{document}

{\Large{$C=$}}

\begin{tikzpicture}
		[cube/.style={very thick,black},
			grid/.style={very thin,gray},
			axis/.style={->,blue,thick}]


			
	%draw the axes
	\draw[axis] (2,2,2) -- (6,2,2) node[anchor=west]{$y$};
	\draw[axis] (2,2,2) -- (2,6,2) node[anchor=west]{$z$};
	\draw[axis] (2,2,2) -- (2,2,4.5) node[anchor=west]{$x$};

	%draw the front of the cube
	\draw[cube] (0,0,4) -- (0,4,4) -- (4,4,4) -- (4,0,4) -- cycle;
	
	%draw the edges of the cube
	\draw[cube] (0,0,0) -- (0,0,4);
	\draw[cube] (0,4,0) -- (0,4,4);
	\draw[cube] (4,0,0) -- (4,0,4);
	\draw[cube] (4,4,0) -- (4,4,4);
	\draw[cube] (0,0,0) -- (0,4,0);
	\draw[cube] (4,4,0) -- (4,0,0);
	\draw[cube] (0,4,0) -- (4,4,0);
	\draw[cube] (0,0,0) -- (4,0,0);
	
\end{tikzpicture}

Figure 1

\end{document}
I want the " C = " to be directly to the left of the cube and "Figure 1" directly to the right. Any ideas?

Thanks
Attachments
A 5.1.13.pdf
(36 KiB) Downloaded 382 times
Last edited by cgnieder on Thu May 02, 2013 8:57 am, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Labeling graphs

Post by cgnieder »

kmath wrote:I want the " C = " to be directly to the left of the cube and "Figure 1" directly to the right.
What do you mean by this? the “ C = ” is to left of the cube and “Figure 1” is to the right of it, aren't they? Can you elaborate a bit?

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Labeling graphs

Post by localghost »

What do "C=" and "Figure 1" actually represent here? Can you put that into an appropriate context? Is this "C" perhaps the label of a (sub-)figure in a set of figures that are described in the joint caption with the label "Figure 1"?


Thorsten
kmath
Posts: 7
Joined: Sat Apr 27, 2013 2:54 am

Re: Labeling graphs

Post by kmath »

Right. I mean I want the C directly next to the cube, instead of above and to left of it.

C represents the cube. And "figure 1" is just representing the picture itself.

It's for an abstract algebra class and my professor is very specific about how he wants things to look...
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Labeling graphs

Post by mas »

You could have put those labels using node command. Or am I understanding the problem differently? Here is my attempt where I have used the \node to put those two labels.

Code: Select all

\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz,tikz-3dplot}
\begin{document}

\begin{tikzpicture}
                [cube/.style={very thick,black},
                        grid/.style={very thin,gray},
                        axis/.style={->,blue,thick}]
                       
        %draw the axes
        \draw[axis] (2,2,2) -- (6,2,2) node[anchor=west]{$y$};
        \draw[axis] (2,2,2) -- (2,6,2) node[anchor=west]{$z$};
        \draw[axis] (2,2,2) -- (2,2,4.5) node[anchor=west]{$x$};

        %draw the front of the cube
        \draw[cube] (0,0,4) -- (0,4,4) -- (4,4,4) -- (4,0,4) -- cycle;
       
        %draw the edges of the cube
        \draw[cube] (0,0,0) -- (0,0,4);
        \draw[cube] (0,4,0) -- (0,4,4);
        \draw[cube] (4,0,0) -- (4,0,4);
        \draw[cube] (4,4,0) -- (4,4,4);
        \draw[cube] (0,0,0) -- (0,4,0);
        \draw[cube] (4,4,0) -- (4,0,0);
        \draw[cube] (0,4,0) -- (4,4,0);
        \draw[cube] (0,0,0) -- (4,0,0);

        \node at (-1.5,1.5,2) {\Large $C=$} ;
        \node at (6.5,1.5,2) {\Large Figure~1} ;
       
\end{tikzpicture}

\end{document}
Is it what you wanted?

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
kmath
Posts: 7
Joined: Sat Apr 27, 2013 2:54 am

Re: Labeling graphs

Post by kmath »

Ya that's it thanks!
Post Reply