I have a tikzpicture with a 4 by 1 groupplot generated by matplotlib2tikz and want to make label in the middle of the picture below the graph, similar to what can be achieved with \centering after \end{tikzpicture}. How this can be done?  Edit: adding a not-so-minimal working example per @Jan 's request (work in progress). What I've tried is in the secon-to-last line:  \begin{tikzpicture}  \begin{groupplot}[group style={group size=4 by 1,  yticklabels at=edge left,  horizontal sep=10pt}] \nextgroupplot[ylabel={\small ylabel}, xmin=0, xmax=60, ymin=0, ymax=60, width=\figurewidth, height=\figureheight, tick align=outside, x grid style={white!80.0!black}, y grid style={white!80.0!black}, axis line style={lightgray!20.0!black}, enlargelimits = false, standard, axis equal ] \addplot [line width=0.7000000000000001pt, black, mark=*, mark size=2, mark options={solid}, only marks] table {% 0.324 0.628 52.706 14.223 }; \addplot [line width=0.7000000000000001pt, black] table {% 0.324 3.05943257386342 52.706 7.39484684158939 }; \addplot [line width=0.7000000000000001pt, black, dashed] table {% 0 0 60 60 }; \nextgroupplot[ xmin=0, xmax=60, ymin=0, ymax=60, width=\figurewidth, height=\figureheight, tick align=outside, x grid style={white!80.0!black}, y grid style={white!80.0!black}, axis line style={lightgray!20.0!black}, enlargelimits = false, standard, axis equal ] \addplot [line width=0.7000000000000001pt, black, mark=*, mark size=2, mark options={solid}, only marks] table {% 0.324 3.241 52.706 5.946 }; \addplot [line width=0.7000000000000001pt, black] table {% 0.324 4.06077185448631  52.706 2.5181107790982 }; \addplot [line width=0.7000000000000001pt, black, dashed] table {% 0 0 60 60 }; \nextgroupplot[ xmin=0, xmax=60, ymin=0, ymax=60, width=\figurewidth, height=\figureheight, tick align=outside, x grid style={white!80.0!black}, y grid style={white!80.0!black}, axis line style={lightgray!20.0!black}, enlargelimits = false, standard, axis equal ] \addplot [line width=0.7000000000000001pt, black, mark=*, mark size=2, mark options={solid}, only marks] table {% 0.324 12.063 52.706 42.776 }; \addplot [line width=0.7000000000000001pt, black] table {% 0.324 11.7510527712628 52.706 41.251917297554 }; \addplot [line width=0.7000000000000001pt, black, dashed] table {% 0 0 60 60 }; \nextgroupplot[ xmin=0, xmax=60, ymin=0, ymax=60, width=\figurewidth, height=\figureheight, tick align=outside, x grid style={white!80.0!black}, y grid style={white!80.0!black}, axis line style={lightgray!20.0!black}, enlargelimits = false, standard, axis equal ] \addplot [line width=0.7000000000000001pt, black, mark=*, mark size=2, mark options={solid}, only marks] table {% 0.324 1.654 52.706 20.3 }; \addplot [line width=0.7000000000000001pt, black] table {% 0.324 1.34479027913101 52.706 20.3653860826401 }; \addplot [line width=0.7000000000000001pt, black, dashed] table {% 0 0 60 60 }; \end{groupplot} \node [anchor=center] at (2\figurewidth,0) {I want a common xlabel}; \end{tikzpicture}   Produced this:    Btw ylabel is also misplaced but that is for another question  Edit2: Solution adapted from the  linked by @percusse :  \node (title) at ($(group c2r1.center)!0.5!(group c3r1.center)+(0,-0.5\figureheight)$) {THE Title};
123712
Using the groupplots library in pgfplots, how can a title be set for a group of plots?  The following code (basically from the manual) is an example layout.  I don't want each plot to have a title, but rather a title be placed centered on top of the group.  \documentclass[crop,tikz]{standalone}  \usepackage{pgfplots} \usepgfplotslibrary{groupplots}  \begin{document}  \begin{tikzpicture}   \begin{groupplot}[     group style={       {group size=2 by 2}},     height=3cm,width=3cm,     title={Title}]      \nextgroupplot     \addplot coordinates {(0,0) (1,1) (2,2)};     \nextgroupplot     \addplot coordinates {(0,2) (1,1) (2,0)};     \nextgroupplot     \addplot coordinates {(0,2) (1,1) (2,1)};     \nextgroupplot     \addplot coordinates {(0,2) (1,1) (1,0)};   \end{groupplot} \end{tikzpicture}  \end{document}
64526
I can't figure out a way to prevent small values showing in my labels. A problem that looked very similar to mine can be found in . Due to my non-existent coding skills I couldn't figure out this on my own. So here is the code I've got so far:  \documentclass{article}  \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.10}  \definecolor{RYB1}{RGB}{128, 177, 211} \definecolor{RYB2}{RGB}{251, 128, 114} \definecolor{RYB3}{RGB}{190, 186, 218} \definecolor{RYB4}{RGB}{255, 255, 179} \definecolor{RYB5}{RGB}{141, 211, 199} \definecolor{RYB6}{RGB}{253, 180, 98}  \pgfplotscreateplotcyclelist{ColorListBar}{ {RYB1!50!black,fill=RYB1}, {RYB2!50!black,fill=RYB2}, {RYB3!50!black,fill=RYB3}, {RYB4!50!black,fill=RYB4}, {RYB5!50!black,fill=RYB5}, {RYB6!50!black,fill=RYB6}, }  \begin{document}      \begin{figure}[H] \begin{center} \begin{tikzpicture} \pgfkeys{      /pgf/number format/precision=2,      /pgf/number format/fixed zerofill=true,     /pgf/number format/fixed } \begin{axis}[ ybar stacked, bar width=9mm, nodes near coords, enlargelimits=0.3, legend style={at={(0.5,-0.20)}, anchor=north,legend columns=-1}, ylabel={ylabel}, symbolic x coords={A, B, C}, xtick=data, cycle list name=ColorListBar ] \addplot plot coordinates {(A,0.26) (B,0.32) (C,0.32)}; \addplot plot coordinates {(A,0.28) (B,0.29) (C,0.35)}; \addplot plot coordinates {(A,0.05) (B,0) (C,0.01)}; \addplot plot coordinates {(A,0.13) (B,0.17) (C,0.17)}; \addplot plot coordinates {(A,0.06) (B,0.01) (C,0.01)}; \addplot plot coordinates {(A,0.05) (B,0.07) (C,0.01)}; \legend{1, 2, 3, 4, 5, 6} \end{axis} \end{tikzpicture} \end{center} \end{figure} \end{document}    This results in a Figure that looks like this:    I would like to remove the labels that currently have the value 0.01 and thus look very cluttered. How could this be achieved?
61792
Sometimes, it's hard to avoid "colliding" marker labels in scatter plots, by which I mean labels that overlap each other. If I don't want to remove data points to avoid the overlap, is it possible to shift individual labels (as with TikZ nodes)? The following MWE illustrates the problem:  \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \begin{document} \begin{tikzpicture}  \begin{axis}[     xlabel=$a$,     ylabel=$b$ ] \addplot[blue,mark=*,mark options={fill=blue},nodes near coords,only marks,    point meta=explicit symbolic] table[meta=label] { x y label 100 152 {Long label 1} 200 180 {Long label 2} 110 150 {Long label 3} }; \end{axis} \end{tikzpicture} \end{document}   Ideally, I would like to be able to adjust selected labels left/right/up/down. Thanks!
28838
I'm using LaTeX with TikZ to create a (right-angle) triangle. Now I would like to label each angle by adding a half circle and a text label.  Unfortunately I only managed to create a label for the gamma angle. What do I need to do in order to put such a label into the remaining corners?  \begin{tikzpicture}[thick] \draw(0,0) -- (90:2cm) node[midway,left]{$opposite leg$} -- (0:4cm) node[midway,above right]{$hypotenuse$} -- (0,0) node[midway,below]{$adjacent leg$}; \draw[fill=lightgray, thick] (0,0) -- (0:0.8cm) arc (0:90:0.8cm) node at (45:0.5cm) {$\gamma$} -- cycle; \end{tikzpicture}
97234
I'm trying to draw a relatively simple chart of a number line, and when one of the nodes is too close to the edge of the plot, it gets cut off.  The code:  \documentclass{article}  \usepackage{natbib} \usepackage{graphicx} \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture} \begin{axis}[   width=\columnwidth,   axis y line=none,   axis lines=left,   axis line style={-},   xmin=0,   xmax=1,   ymin=0,   ymax=1,   xlabel=$\mu$,   scatter/classes={o={mark=*}},   restrict y to domain=0:1,   xtick={0,1} ] \draw[ultra thin] (axis cs:0, 0) -- (axis cs:0,.05); \draw[ultra thin] (axis cs:.4, 0) -- (axis cs:.4,.05); \node[coordinate,label=above:{$B$}] at (axis cs:0.0,0.05) {}; \node[coordinate,label=above:{$A$}] at (axis cs:0.4,0.05) {}; \node[coordinate,label=above:{$b$}] at (axis cs:0.2,0.02) {}; \node[coordinate,label=above:{$a$}] at (axis cs:0.7,0.02) {}; \end{axis}; \end{tikzpicture} \end{document}   The Result:    How do I get the B to fully render?
42937
I would like to place n points over a circumference like Figure 3 of this . I'd choose the label to be assigned to each vertex and color and I'd like to have the code in TikZ-pgf.
111016
\fbox{ \begin{tikzpicture}[scale=1,auto=center]   \node[circle,fill=gray!20] (n1) at (2,8) {Node A};   \node[circle,fill=gray!20] (n2) at (8,8) {Node B};   \foreach \from/\to in {n1/n2}   \draw (\from) -- (\to) node[draw=none,fill=none,font=\scriptsize,midway,below] {text below}; \end{tikzpicture} }   The example show how to put text below the line in middle, but how to write the text below and above the line in middle (simultaneously) between two nodes? ...
93602
I'm trying to center the node values, at the middle of each bar, in a stacked plot. However I can only put those nodes in the top of each bar. Is it possible to move those down? To the center of each bar to be more precise.  \documentclass{article}  \usepackage{tikz} \usepackage{pgfplots}  \begin{document} \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Population, enlargelimits=0.05, legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1}, ybar stacked, nodes near coords, nodes near coords align={center}, ] \addplot coordinates {(1930,50e6) (1940,33e6) (1950,40e6) (1960,50e6) (1970,70e6)}; \addplot coordinates {(1930,38e6) (1940,42e6) (1950,43e6) (1960,45e6) (1970,65e6)}; \addplot coordinates {(1930,15e6) (1940,12e6) (1950,13e6) (1960,25e6) (1970,35e6)}; \addplot coordinates {(1930,15e6) (1940,12e6) (1950,13e6) (1960,25e6) (1970,35e6)};  \legend{Far,Near,Here,There} \end{axis} \end{tikzpicture} \end{document}   So this is what I got     Edit  Ok, thanks to Jake now the example above works. I also notice that my example using floats wasn't working because I didn't use the \makeatletter after the document.  However, when I'm using float values using the solution the bars don't appear as they are when not using them.  Before using the values:    And after the example I got:    The code is this  \documentclass{standalone}  \usepackage{tikz} \usepackage{pgfplots}  \pgfplotstableread{ 1   19.178  26.027  8.219   6.849   39.726 2   54.795  21.918  4.110   6.849   12.329 3   28.767  16.438  6.849   8.219   39.726 4   63.014  2.740   2.740   2.740   28.767 5   90.411  1.370   6.849   0.000   1.370 6   15.068  2.740   16.438  8.219   57.534 7   67.123  0.000   0.000   0.000   32.877 8   72.603  6.849   5.479   0.000   15.068 9   56.164  12.329  6.849   4.110   20.548 10  50.685  4.110   8.219   1.370   35.616 }\datatable  \begin{document} \makeatletter \begin{tikzpicture} \begin{axis}[     ylabel=label,     xtick=data,     xticklabels={S1,S2,S3,S4,S5,S6,S7,S8,S9,S10},     enlarge y limits=false,     enlarge x limits=0.1,     ymin=0,ymax=100,     ybar stacked,     bar width=10pt,     legend style={       font=\footnotesize,       cells={anchor=west},       legend columns=5,       at={(0.5,-0.15)},       anchor=north,       /tikz/every even column/.append style={column sep=0.2cm}     },     % Comment from here to produce the first plot     point meta=explicit,     calculate offset/.code={         \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}         \pgfmathsetmacro\testmacro{(\pgfplotspointmeta*10^\pgfplots@data@scale@trafo@EXPONENT@y)/2*\pgfplots@y@veclength)}         \pgfkeys{/pgf/fpu=false}     },     every node near coord/.style={         /pgfplots/calculate offset,         yshift=-\testmacro     },     nodes near coords,     nodes near coords align=center ] \addplot table [meta index=1] \datatable; \addplot table [y=1, meta index=2] \datatable; \addplot table [y=2, meta index=3] \datatable; \addplot table [y=3, meta index=4] \datatable; \addplot table [y=4, meta index=5] \datatable; % This code produces the first plot %\addplot table[x index=0,y index=1] \datatable; %\addplot table[x index=0,y index=2] \datatable; %\addplot table[x index=0,y index=3] \datatable; %\addplot table[x index=0,y index=4] \datatable; %\addplot table[x index=0,y index=5] \datatable; \legend{Far,Near,Here,There,NotThere} \end{axis} \end{tikzpicture} \end{document}
107968
I'm trying to create a Horizontal Probability Tree with Level Labels using tikz. (Not tikz-qtree). Right now, I have a horizontal tree. The labels are NOT aligned to the top of the diagram. I would like to have all the labels aligned without having to manually tweak positions.   Here is the MWE:  \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm] \tikzstyle{level 2}=[level distance=4.5cm, sibling distance=1.5cm] \tikzstyle{level 3}=[level distance=3.5cm, sibling distance=2cm]   \tikzstyle{bag} = [text width=4em, text centered] \tikzstyle{end} = [rectangle, draw=none, minimum width=3pt, inner sep=0pt]  \tikzstyle{ans} = [color=red]   \begin{tikzpicture}[level distance=5cm, level 1/.style={sibling distance=3.5cm}, level 2/.style={sibling distance=1.2cm}, level 3/.style={level distance = 2cm},grow'=right] \tikzstyle{every node}=[]     \node (Root) [] {Origin}         child [] {         node {Door A}         child { node {A}                  child {node[end] {$0$} }                 edge from parent                 node[left] {$0$}         }         child [black] { node {B}                  child {node[ans,end] {$\frac{1}{6}$} }                 edge from parent                 node[ans,left] {$\frac{1}{2}$}         }         child [black] { node {C}                  child {node[ans,end] {$\frac{1}{6}$} }             edge from parent             node[ans,left] {$\frac{1}{2}$}         }         edge from parent         node[above] {$\frac{1}{3}$}     }     child {         node {Door B}         child { node {A}                  child {node[ans,end] {$0$} }                 edge from parent                 node[ans,left] {$0$}         }         child { node {B}                  child {node[end] {$0$} }                 edge from parent                 node[ans,left] {$0$}         }         child { node {C}                  child {node[ans,end] {$\frac{1}{3}$} }                 edge from parent                 node[ans,left] {$1$}         }         edge from parent         node[ans,left] {$\frac{1}{3}$}     }     child {         node {Door C}         child { node {A}                  child {node[ans,end] {$0$} }                 edge from parent                 node[ans,left] {$0$}         }         child { node {B}                 child {node[ans,end] {$\frac{1}{3}$} }                 edge from parent                 node[ans,left] {$1$}         }         child { node {C}                 child {node[end] {$0$} }                 edge from parent                 node[ans,left] {$0$}         }         edge from parent         node[ans,left] {$\frac{1}{3}$}     };    % How I'm applying labels to each level.    % Need to be able to dynamically align nodes at top level \begin{scope}[every node/.style={above}]  \path (Root    -| Root)  ++(0,15mm) node {Test};  \path (Root-1   -| Root-1)  ++(0,15mm) node {Contestant Chooses};  \path (Root-1-1  -| Root-3-3-1)  ++(10mm,13mm) node {Host Reveals Door};  \path (Root-1-1-1 -| Root-3-3) ++(0,15mm) node {Probability}; \end{scope}   \end{tikzpicture}   I get this    and want this
83045
Help me to plot the following plot using Hobby.   I have tried to plot it. My code is  \begin{tikzpicture}[use Hobby shortcut]  \draw (-.3 ,1).. (0, 0) .. ( 1.2 , 0 ) .. ( 0 , 0 ) .. (-.3 ,-1);  \draw (.45, 0) .. ( .9 , 0 ) .. ( .6 , 0 ) .. ( .7 , -0.01); \draw  (-.15, 1.2).. (-.01, .2) ..(.01, .22).. (.6, .1) .. ( 1.3 , 0 ) .. ( 0 , -.1 ) .. (-.3 ,-1.2); \node[inner sep=1pt,circle,fill=black] at  ( .7 , -0.01) {}; \end{tikzpicture}   Please correct my code to get the desired fig. Also I want to write HL adjacent to the Fig.
56474
I want a tikzpicture inside a tcolorbox. But for some reason it floats outside the box. How can I center the image correctly?    \documentclass[10pt, a4paper, twoside, titlepage, openbib]{article}      \usepackage{tikz}         %Tikz is een library die toestaat om tekeningen te maken         \usetikzlibrary{shapes}             %Shapes         \usetikzlibrary{arrows}             %Arrows         \usetikzlibrary{calc}             %Calculation         \usetikzlibrary{decorations}             %Decorations         \usetikzlibrary{backgrounds}             %Backgrounds         \usetikzlibrary{fit}             %         \usetikzlibrary{positioning}             %         \usetikzlibrary{chains}             %     \usepackage[europeanresistors,americaninductors]{circuitikz}     \usepackage{tcolorbox}         %http://mirror.unl.edu/ctan/macros/latex/contrib/tcolorbox/tcolorbox.pdf         \tcbuselibrary{listings}         \tcbuselibrary{theorems}  \begin{document}  %---Image--------------------------------------------------------------------------------------------    \begin{figure*}[ht!] %het blokschema     \centering     \begin{tcolorbox}[colback=white]     \begin{tikzpicture}[node distance = 0.2cm, auto]         \begin{circuitikz}             \draw                 (8.5,-1.) node[draw,minimum width=2cm,minimum height=2.4cm] (load) {Load}                     ($(load.west)!0.75!(load.north west)$) coordinate (la)                     ($(load.west)!0.75!(load.south west)$) coordinate (lb)                 (1,3) node[spdt,xscale=1, yscale=1,anchor=in] (myspdt1) {}                 (4,3) node[spdt,xscale=-1,yscale=1,anchor=in] (myspdt2) {}                 (5,0)   node[ground, yscale=1]{}                         to[full led]        (5,3)                         to(myspdt2.in)                 (0,0)   node[ground]{}                         to[vsourcesin]      (0,3)                         to(myspdt1.in)                 (0,2) node[right]{$V_{s}(t)$}                 (myspdt1.out 1) -- (myspdt2.out 1)                 (myspdt1.out 2) -- (myspdt2.out 2);         \end{circuitikz}     \end{tikzpicture}     \end{tcolorbox}            \caption{Het eerste probleem}          \label{fig:Het eerste probleem}  \end{figure*} %---Image--------------------------------------------------------------------------------------------  \end{document}
52194
actually it's an easy question, but I could find an answer with Google or the included search on StackExchange ;)  How do I add in the middle of the line a node with Tikz? I want somethink like this:  --------------&gt;      text   Normally I did it with an additional node at command. If I will resize the the arrow then I need to change the position of the node also.  ----------&gt;    text   Which is not the best way for big things. I try to find something in the manual and didn't find an answer yet.   Thanks.  Best regards.
107943
I've looked to another example but struggle to adapt it to my needs. Tikz is new to me.    \begin{center}   \begin{tikzpicture}[every edge/.style={shorten &lt;=1pt, shorten &gt;=1pt}]   \draw (0,0)  node [below] {0} -- (1,0) node [below] {1};   % draw the tick marks   \coordinate (p) at (0,2pt);   \foreach \myprop/\mytext [count=\n] in {0.06/$p_1$,0.06/$p_2$,0.06/$p_3$,0.06/$p_4$,0.06/$p_5$,0.15/$p_6$,0.13/$p_7$,0.14/$p_8$,0.15/$p_9$,0.13/$p_10$}   \draw [decorate,decoration={brace,amplitude=2}] (p)  edge [draw] +(0,-4pt) -- ++(\myprop,0) coordinate (p) node [midway, above=2pt, anchor=south] {\mytext} ;   \path (1,2pt) edge [draw]  ++(0,-4pt); \end{tikzpicture} \end{center}     Latex squeeze all the values together instead of spreading them over the 0 to 1 axis.
8766
I'm trying to draw a grouped bar plot, but with added dots "on top" to signify outliers in the results.  Currently I have:      \begin{figure}[]       \begin{tikzpicture}         \begin{axis}[             width  = 1*\textwidth,             height = 4.5cm,             major x tick style = transparent,             ybar=1*\pgflinewidth,             bar width=13pt,             symbolic x coords={A,B,C,D},             xtick = data,             enlarge x limits=0.25,             ymax=15,             ymin=0,             legend cell align=left,             legend style={                     at={(1,1.05)},                     anchor=south east,                     column sep=1ex             }         ]             \addplot[style={fill=red,mark=none}]                 coordinates {(A, 4.44) (B,0.1) (C,4.37) (D,4.07)};              \addplot[style={fill=green,mark=none}]                 coordinates {(A, 0.4) (B,0.8) (C,0.3) (D,0.5)};              \addplot[style={fill=blue,mark=none}]                 coordinates {(A, 0.2) (B,0) (C,0.9) (D,0.8)};              \addplot[style={fill=yellow,mark=none}]                 coordinates {(A, 9.59) (B,0.2) (C,8.86) (D,8.62)};          \draw node[fill,circle,scale=0.5]{} (axis cs:A,7);         \draw node[fill,circle,scale=0.5]{} (axis cs:B,11);         \draw node[fill,circle,scale=0.5]{} (axis cs:C,3);         \draw node[fill,circle,scale=0.5]{} (axis cs:D,12);          \legend{C1,C2,C3,C4}       \end{axis}     \end{tikzpicture} \end{figure}   This draws the grouped plots etc, but the "dots" always appear at the (0,0) position, ignoring the relative coordinates. See the picture below, where it is close to the "A". Ideally, I'd like to position such a dot above every bar in the graph. How can I properly specify the coordinates?
59834
I've just started to play with pgfplot. I'm trying to prepare a plot like to following   \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[minor tick num=1,  axis x line=middle, axis y line=middle, xlabel=$k$, ylabel=$\omega$, ymin=0,xmin=-2,ymax=60] \addplot[blue,domain=0:5, line width=1.5pt] {x^2+25}; \addplot[orange,domain=0:5,line width=1pt]{3*x+22.75}; \addplot[cyan,domain=0:1.5, line width=1pt,dashed]{18.166*x}; \node[coordinate,pin=right:{$v_{\phi}=\frac{\omega}{k}$}]     at (axis cs:1,17) {}; \node[coordinate,pin=right:{$v_{g}=\frac{d\omega}{dk}$}]     at (axis cs:2.5,30) {}; \node[coordinate,pin=left:{dispersion relation}]     at (axis cs:4.5,47) {}; \end{axis} \end{tikzpicture} \caption{Wave dispersion relation with phase and group velocity} \label{fig:2} \end{figure}   What I would like to do is dropping the x-y tick labels so that we just maintaing the x-y title. How can I obtain it?
7717
iam trying to fill above the green and the red line, between the two brown lines. Ive tried it with soft clip and domain, but i cant get it working. Here is what iam trying to achieve (thick organe lines or just this space filled).  Code so far is: \documentclass{standalone}  \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{patterns}  \begin{document} \begin{tikzpicture}     \begin{axis}[grid=both,ymin=-5,ymax=5,xmax=5,xmin=-5,xticklabel=\empty,yticklabel=\empty,       minor tick num=1,axis lines = middle,xlabel=$x_1$,ylabel=$x_2$,label style =       {at={(ticklabel cs:1.1)}}]       \addplot[draw=green, name path=A]{7/2 -2*x};        \addplot[draw=red, name path=B]{3/2 - x/2};       \addplot[draw=blue, name path=C]{1- x/3};        \addplot +[mark=none,draw=brown, name path=D] coordinates {(1,-6) (1,6)};       \addplot +[mark=none,draw=brown, name path=E] coordinates {(2,-6) (2,6)};      \end{axis}   \end{tikzpicture} \end{document}  Thanks in advance!
104509
The following are my code. I used the axis environment for better axis style. I try to add nodes at g^W=g^L, which is a point on the y-axis, but the axis environment seemes to cut off anything outside the axis. What should I do?  \documentclass[11pt]{article} \usepackage{pgfplots} \begin{document}  \begin{figure} \centering \begin{tikzpicture}[scale = 1.2]      \begin{axis}[xmin=0,xmax=10,ymin=0,ymax=7,         axis lines = left, axis line style = thick,  unit vector ratio=1 1 1, xtick={0,8},         xticklabels = {$p^w=0$, $p^w=1$},         ytick={1.5,3,5.5},         yticklabels = {$g^L-\beta$,$g^W=g^L$,$g^w+\alpha$}]         \addplot[mark=none, dashed] coordinates {(8, 0) (8, 7)};          \addplot[domain=0:8, dashed] {1.5};         \addplot[domain=0:8, dashed] {3};          \node[black,right] at (axis cs:8,1.5){\small{$W=0$}};         \node at (axis cs:8,1.5) [circle, scale=0.3, draw=black!80,fill=black!80] {};         \node at (axis cs:8,3) [circle, scale=0.3, draw=black!80,fill=black!80] {};         \node at (0,3.5) [circle, scale=0.3, draw=black!80,fill=black!80] {};       \end{axis} \end{tikzpicture} \caption{A caption.} \end{figure}   \end{document}