ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Placement of a figure made with TiKz
Date: Sun, 29 Jul 2018 13:01:20 +0200	[thread overview]
Message-ID: <CACyK-eoSFfx8-2HSiOrTd8ViXpsqbT2ZdDzdOV8MXdRVr-8CZg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2007 bytes --]

Hello,
I do not understand why figure 2 does not fit correctly like the other two.
Thank you
Fabrice


\useMPlibrary[dum]

\usemodule[tikz]

\usemodule[pgfplots]
\pgfplotsset{compat=newest}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}

\setuplayout
  [height=middle,
   width=middle,
   backspace=2cm,
   topspace=10mm,
   bottomspace=10mm,
   header=10mm,
   footer=10mm,
   footerdistance=10mm,
   headerdistance=10mm]

\showframe

\starttext

\placefigure[right]{first}{\externalfigure[dummy]}

\placefigure[right]{second}{
  \hbox{
    \starttikzpicture[thick]
\switchtobodyfont[9pt]
\startaxis[
x=3cm,y=3cm,
axis line style = thick,
major tick style=black,
xtick={0,0.25,...,1},ytick={0,0.25,...,1},
ymin=-0.25,ymax=1.25,xmin=-0.25,xmax=1.5,
axis on top=true,
axis lines=middle,
tickwidth=0.15cm,
minor tick num=3,
major tick style = {thick, black},
axis line style = thick,
yticklabels={,,},
xticklabels={,,},
major tick style=black,
extra x ticks={1.25},
extra x tick label={\null},
xlabel=$x$,ylabel=$y$,
every axis x label/.style=
      {
        at={(ticklabel* cs:1)},
        anchor=west
      },
      every axis y label/.style=
      {
        at={(ticklabel* cs:1)},
        anchor=south
      },
      >=stealth]

\coordinate [label=below left  : $A$](A) at (0,0);
\coordinate [label=below right : $B$](B) at (1,0);
\coordinate [label=below right : $C$](C) at (1,1);
\coordinate [label=above left  : $D$](D) at (0,1);
\coordinate (M) at (0.25,0);
\coordinate (N) at (1,0.25);
\coordinate (P) at (0.75,1);
\coordinate (Q) at (0,0.75);

\node[below left] at (M) {$M$};
\node[right] at (N) {$N$};
\node[above] at (P) {$P$};
\node[left]  at (Q) {$Q$};

\node[left] at (0,1){$1$};
\node[below] at (1,0){$1$};

\draw (A)--(B)--(C)--(D)--cycle ;
\draw [draw=red, fill=red!70](M)--(N)--(P)--(Q)--cycle ;

\stopaxis
\stoptikzpicture
  }
}


\placefigure[right]{third}{
  \hbox{
    \starttikzpicture
      \draw[draw=red,fill=red!70] (0,0) rectangle (3,3);
    \stoptikzpicture
  }
}
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 2938 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2018-07-29 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-29 11:01 Fabrice Couvreur [this message]
2018-07-29 11:18 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACyK-eoSFfx8-2HSiOrTd8ViXpsqbT2ZdDzdOV8MXdRVr-8CZg@mail.gmail.com \
    --to=fabrice1.couvreur@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).