pgf

How to get one component of a tikz/PGF coordinate?

I'm trying to draw a horizontal line across my diagram. The Y coordinate of the line should be halfway between points a and b (a is below b). The left and right endpoints of the line are on the bounding box of the tikzpicture. Here's how I'm doing this now, using the intersection operator: \coordinate (h0) at ($(a.north)!0.5!(b.south)$)...

Trees and macros with tikz

I am trying to build my trees using macros but I don't get the result I want. Here is a minimal example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \newcommand{\LeafNode}[1]{% child {node {#1}} } \newcommand{\InnerNode}[3]{% child {node {#3} #1 #2 } } \begin{document} \begin{...

How to control font sizes in pgf/tikz graphics in latex?

Hi, I'm creating graphs in pgf/tikz. When I use these in my document they are scaled, several are in minipage/subfig like environments. When this happens the font sizes are scaled with the graphics making them very small or unreadable. I've been through the manual but have so far been unsuccessful in my attempts to control this. Is the...

Control font size in graphics in LaTeX when scaling in minipage/subfig?

Hi, I am using pgf/tikz graphics and I'm wondering how one can control the scaling of font sizes in the graphics when using them in minipage/subfig environments? Is there a way to manually set a permanent font size for pgf/tikz graphics or in latex in general so as to make font sizing invariant to scaling? Ideally I'd like to be able ...

The way to find out whole picture width in PGF (Latex)

I've got a latex macro that draws a picture using PGF and Tikz according to given parameters. The width of picture drawn depends on these parameters. PGF automatically calculates the resulting width of any picture drawn so the user does not have to set it explicitly(like for example when using latex build in picture environment). Howe...

Compare floating point numbers in Latex

I am trying to use \ifthenelse to do a floating point comparison. This is the pgf/tikz code, which works if \y is integer only, but not otherwise: \foreach \y in {3,3.5,...,6} { ifthenelse{\y<3}{ ... }{ ... } } ...

Problem with pgfplot label

I want to draw an x-y-diagram with axis labels. Unfortunately the ylabel is misplaced. It looks as depending on the actual data. When the other data line in the sample below is used instead of the upper line, it looks better. How can I move the label to the left or (more desirable) how can I tell pgfplot to do it corectly? % !TEX TS-pro...

Positioning of hyperlinked shapes with matrix in tikz

I can draw a hyperlinked shape in tikz using the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \usepackage{hyperref} \begin{document} \begin{tikzpicture} \node {% \href{http://www.stackoverflow.com}{% \begin{tikzpicture} \filldraw[blue] circle(1cm) node [white] {Click}; \end{tikzpicture}}}; \end{...

Aligning matrix nodes in tikz

Another question about aligning nodes using matrices in tikz. Consider the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix (m)[matrix of nodes, column sep=5mm,row sep=3mm, align=center, nodes={rectangle,draw, text width = 2cm} ]{ & \node{row1-2...

How to Find Intersections with Ellipses in PGF/TikZ

Hello, I am trying to display a sphere in PGF/TikZ to illustrate the idea of great circles. The code for my current result is: \begin{tikzpicture} \tikzfading[name=fade right, left color=transparent!20, right color=transparent!90] \tikzfading[name=fade out, inner color=transparent!100, outer color=transparent!10] \tikzfading[name=fa...

pgf/tikz: String Symbols as Input Coordinates

Hi all, I'm new to pgf so i was trying out some examples from the pgfplot manual. One example is especially relevant for my current task but, alas, it would not compile. Here is the code: \documentclass[11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[symbolic x coords={a,...

Tikz: horizontal centering of group of nodes

Hi, I need to align each row of the graph to the center. I am trying to do it with xshift. Here the code: \begin{tikzpicture}[node distance=1.5cm, auto, text centered] \tikzstyle{every node}=[draw,ball]; \begin{scope}[xshift=1.5cm] \node (A) {A}; \node [right of=A] (B) {B}; \node [right of=B] (C) {C};...

How do I set the minimum width of a subfigure in LaTeX?

I have: \subfigure[blah blah blah.] { \begin{tikzpicture}[/MyStyle] ... some stuff... \end{tikzpicture} } But "some stuff" is not that wide and the text in the subfigure produces a lot of underfull hboxes. I want to make the subfigure wider. How do I do that? ...

Improving a Tikz Diagram

I have just finished my first diagram in Tikz. It looks as I wanted it to, but am unhappy with how I have 'coded' it: \begin{tikzpicture} [node distance=14mm, item/.style={rounded corners,rectangle, thick, minimum width=20mm, minimum height=10mm}] \node[item,draw=blue!50,fill=blue!20] (stack) {1394 Stack}; \node[item,left=of sta...

Software to draw graphical models in plate notation

So I see graphical models expressed in plate notation in research papers and online all the time (for example: http://www.cs.princeton.edu/~blei/papers/BleiNgJordan2003.pdf). Is there a quick and easy way to produce these?? I've searched and searched but all I've found are solutions like GraphViz which are really way more powerful than...

LaTeX: Resize PGF image (but not text)

Hello, How can I resize a pgf image in LaTeX, but keep the text in the image the same size? I can't use \resizebox because this also resizes the text. I understand that I can use the following in my pgf file: \begin{tikzpicture}[scale=2] However, that scales the image, rather than letting me resize it to a specific width. So this i...

Incorrect alignment of nodes in subpictures

I am using tikz to typeset a diagram in a latex document. I have a grid of 'grid-diagrams', with each grid-diagram drawn as a separate tikz picture and then arranged into the grid as nodes. I want to draw a circle node (which will eventually contain a label) in the bottom-right hand square of each grid-diagram. I use exactly the same...