I'm trying to replicate the following diagram in Tikz:

enter image description here

Where the borders encompass a right angled triangle, with dashed lines (not in picture) joining (0,0.5--1,0) and (0,1--0,5,0). Moreover, it has 2 dashed lines around the (1/3,1/3) point. These lines are kind of triangular, but smooth (so without kinks).

I have attempted the following:

    %Drawing the border
    \draw (0,0) -- (0,11) (0,0) -- (11,0);
    \draw [->] (0,11);
    \draw [->] (11,0);
    \draw (10,0) -- (0,10);
    % Drawing dashed lines
    \draw[dashed] (0,5) -- (10,0);
    \draw[dashed] (5,0) -- (0,10);

But have no idea how to draw those dashed smooth triangles. Note that this need not to follow any particular equation, just a rough sketch is satisfactory :).

An astute commenter pointed out that the 1/3, 1/3 is on the intersection of the two lines! My drawn diagram forgot about this.

  • 2
    please can you post a compile-able example rather than just a snippet?
    – Thruston
    Apr 19, 2018 at 14:42
  • OT, but also (1/3, 1/3) will be at the intersection of those two lines...
    – Thruston
    Apr 19, 2018 at 14:47
  • Ah of course! You're right. 1/3, 1/3 is at the intersection! Silly me.
    – Tamay
    Apr 19, 2018 at 14:50

4 Answers 4


With smooth cycle you can draw smooth triangles. You can make it rounder by playing with tension.

    %Drawing the border
    \draw (0,0) -- (0,11) (0,0) -- (11,0);
    \draw [->] (0,11);
    \draw [->] (11,0);
    \draw (10,0) -- (0,10);
    % Drawing dashed lines
    \draw[dashed] (0,5) -- (10,0);
    \draw[dashed] (5,0) -- (0,10);
    \draw[dashed] plot[smooth cycle] coordinates {({10/3-\myx/3},{10/3+\myx})
    ({10/3+\myx},{10/3-\myx/3}) ({10/3-\myx/3},{10/3-\myx/3}) };
    \draw[dashed] plot[smooth cycle] coordinates {({10/3-\myx/3},{10/3+\myx})
    ({10/3+\myx},{10/3-\myx/3}) ({10/3-\myx/3},{10/3-\myx/3}) };

enter image description here

  • Amazing! If one more person upvotes this question, I'll have enough reputation to upvote your answer :)
    – Tamay
    Apr 19, 2018 at 15:29

Same idea as @marmot, another code (varying the tension and the scale factor in the same time).

    %Drawing the border
    \draw (0,0) edge[-latex] (0,11) edge[-latex] (11,0) (10,0) -- (0,10);
    % Drawing dotted lines
    \draw[dotted, very thick] (0,5) -- (10,0) (5,0) -- (0,10);
    % The barycenter
    \fill[red] (10/3,10/3) coordinate (O) circle(3pt);
    % The smooth triangles
    \foreach[evaluate={\t=1-~/10}] ~ in {1,...,9}
        \draw[blue,scale around={~/10:(O)},smooth cycle,tension=\t,dashed, thick]
            plot coordinates {(0,0) (0,10) (10,0)};

enter image description here


An option that in my opinion is more practical, is to use the tkz-euclide package that is designed for this type of graphics, in the case of the drawing that you pose, you can use the centroid (or any other point) and look for points towards the vertices to then draw the internal triangles.

You can get this:

enter image description here

or This:

enter image description here Here is the code:

% By J. Leon V.  coded based on the BSD, MIT, Beerware licences.

    % Set limits.
        \tkzInit[xmax=20,xmin=-1,ymax=20, ymin=-1]
    %\tkzGrid[sub,color=blue!10!,subxstep=.5,subystep=.5] %HIDE CARTESIAN GRID
    %Define principal points. (10X)
     %Calculate points.
    \tkzDefBarycentricPoint(O=1,X1=10) \tkzGetPoint{A}
    \tkzDefBarycentricPoint(O=1,X2=10) \tkzGetPoint{B}  
    \tkzDefMidPoint(O,A) \tkzGetPoint{C}
    \tkzDefMidPoint(O,B) \tkzGetPoint{D}
    \tkzDefBarycentricPoint(O=2,A=1) \tkzGetPoint{c} 
    \tkzDefBarycentricPoint(O=2,B=1) \tkzGetPoint{d}
    \tkzCentroid(A,B,O) \tkzGetPoint{G} 

    \foreach \y [count=\i] in {1,..., 4}{
                \tkzDefBarycentricPoint(O=1,G=\y) \tkzGetPoint{GO\i} 
                \tkzDrawPoint[fill=red,size=10pt,](GO\i) % SHOW HIDEN POINTS GO
                \tkzDefBarycentricPoint(A=1,G=\y) \tkzGetPoint{GA\i} 
                \tkzDrawPoint[fill=red,size=10pt,](GA\i) % SHOW HIDEN POINTS GA
                \tkzDefBarycentricPoint(B=1,G=\y) \tkzGetPoint{GB\i} 
                \tkzDrawPoint[fill=red,size=10pt,](GB\i) % SHOW HIDEN POINTS GB
                \draw[dashed] plot[smooth cycle] coordinates{

    \tkzDrawSegments[dashed](B,C A,D)
    \tkzDrawVectors[thick](O,X1 O,X2)
    \tkzMarkRightAngle(X2,O,X1) % For the case of 90 degres

%   %Labels:
    \tkzLabelPoint[below](A){ $A$}
    \tkzLabelPoint[left](B){ $B$}
    \tkzLabelPoint[left](G){\sf Centroid}


  • 3
    @marmot You can ask a question when it doesn't work. He used to be a very active user and still stops by occasionally. tex.stackexchange.com/users/3144/alain-matthes It is a pretty decent tool for me to be honest.
    – percusse
    Apr 19, 2018 at 16:48
  • @Tamay, in my case I use a separated tex code that is compiled and exported to a pdf, and then is included in the main document, the standalone document class crops the canvas, and when you import the pdf in the main document using for example graphics package (that gives you many controls for positioning), there is no lost of quality it still a vertor image, the pdf produced is low of file size (36KB in this example) and has no significant effect in the increment of size of the principal document.
    – J Leon V.
    Apr 19, 2018 at 18:48
  • @Kpym Thank you so much!!!! Yes, that solved it. (But in some way this confirms what I was suspecting, namely that I screwed it simply because I cannot understand the French manual.) Anyway, I am going to remove all my above comments now.
    – user121799
    Apr 19, 2018 at 20:00
  • @Kpym I am wondering if I should write an official question which you might answer. I am suspecting that I am not the only one having this problem.
    – user121799
    Apr 19, 2018 at 20:06
  • 1
    @marmot I'm serenely not the person to answer this question, because I don't use very much tkz-euclid. If you are interested in a english cheatsheet I have created one for myself (originally it was in french ;)).
    – Kpym
    Apr 19, 2018 at 20:17

You might also like a Metapost version, that shows how to do nice smooth cycle paths (in red). This is done using luamplib so compile with lualatex - or workout how to convert it for pdflatex with the gmp package (or plain MP).

enter image description here

    numeric u;
    u = 144;
    path xx, yy;
    xx = origin -- right scaled 1.1u;
    yy = xx rotated 90;

    z0 = (1, 1) scaled 1/3 u;

    draw (0, 1/2u) -- (u, 0) -- (0, u) -- (1/2u, 0) 
         dashed evenly scaled 1/2 
         withcolor 1/2 white;

    dotlabel.llft("$x$", z0);

    % this is how to make a nice "smooth cycle" curve
    % default tension is 1 and gives something more like a circle
    % tension infinity gives straight lines
    def :: = .. tension 3 .. enddef;
    for t=1/5, 1/3:
        draw t[z0, (0,0)] ::
             t[z0, (0,u)] ::
             t[z0, (u,0)] :: cycle 
             dashed withdots scaled 1/4
             withcolor 2/3 red;

    drawarrow xx; label.rt ("$x_1$", point 1 of xx);
    drawarrow yy; label.top("$x_2$", point 1 of yy);

    draw (down--up) scaled 1 shifted (1/3u,0);
    draw (down--up) scaled 1 shifted (1/2u,0);
    draw (down--up) scaled 1 shifted (   u,0);
    label.bot("$\frac13$", (1/3u, 0));
    label.bot("$\frac12$", (1/2u, 0));
    label.bot("$1$", (u,0));

    draw (left--right) scaled 1 shifted (0, 1/3u);
    draw (left--right) scaled 1 shifted (0, 1/2u);
    draw (left--right) scaled 1 shifted (0,    u);
    label.lft("$\frac13$", (0, 1/3u));
    label.lft("$\frac12$", (0, 1/2u));
    label.lft("$1$", (0, u));


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .