ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange behavior with TikZ
@ 2017-10-05 17:26 Fabrice Couvreur
  2017-10-05 20:35 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: Fabrice Couvreur @ 2017-10-05 17:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello,
If I put any image, there is no problem : the title of the section is in
color and the text in black.
With a graphic made with TikZ, the title and the text are in color.
Thank you for your help.
Fabrice

\usemodule[tikz]

\usemodule [graph]

\usemodule[pgfplots]

\pgfplotsset{compat=newest}

\definecolor[Mycolor][c=.6,m=0.8,y=0,k=0]

\unexpanded\def\interff#1#2{\math{\left[#1\,;#2\right]}}

\setuphead
   [section]
   [textcommand=,
    color=magenta,
    style=]


\starttext
\startsection[title={Résoudre graphiquement une équation
\math{f(x)=g(x)}},sectionsegments=section,color=magenta]

\placefigure[none,right]{}{
\hbox{\switchtobodyfont[8pt]
\starttikzpicture[/pgf/declare function={f(\x)=\x^2-3;},/pgf/declare
function={g(\x)=-\x^2+2*\x+1;}]
\startaxis[
 restrict x to domain=-3:3, xmax=3, xmin=-3,
 restrict y to domain=-5:4, ymax=4, ymin=-5,
 x=1cm,
 y=0.5cm,
 axis x line = middle,
 axis y line = middle,
 axis line style = thick,
 major grid style=Mycolor,
 minor grid style=Mycolor,
 grid=both,
 xtick={-2,...,2},
 ytick={-4,...,3},
 extra x ticks={-3,3},
 extra x tick label={\null},
 extra y ticks={-5,4},
 extra y tick label={\null},
 extra tick style={tick style={draw=none}},
 every tick/.style={
        black,
        thick,
      },
 y tick label style={
           /pgf/number format/1000 sep={}
       },
 xlabel=$x$,ylabel=$y$,
 every axis x label/.style={
    at={(ticklabel* cs:1.01)},
    anchor=west,
},
every axis y label/.style={
    at={(ticklabel* cs:1.01)},
    anchor=south,
},
 samples=2000,
 >=stealth,
  ]
\addplot[only marks,mark=x,color=black,mark options={scale=1.5},
    thick] table[x=Nombre,y=Valeur]{
           Nombre   Valeur
            -1       -2
             2       1
} ;
\addplot [smooth,domain=-1.5:2.5, thick,magenta] {f(x)} ;
\addplot [smooth,domain=-1.5:2.5, thick,green] {g(x)} ;

\node[above left,green] at (2,2) {\math{{\cal C}_g}} ;
\node[below right,magenta] at (1.5,-1) {\math{{\cal C}_f}} ;
\node[below left ] at (-0.1,-0.1) {\math{0}} ;

\node[fill=black,circle,scale=0.4,magenta] at (-1.5,{f(-1.5)}){} ;
\node[fill=black,circle,scale=0.4,magenta] at (2.5,{f(2.5)}){} ;

\node[fill=black,circle,scale=0.4,green] at (-1.5,{g(-1.5)}){} ;
\node[fill=black,circle,scale=0.4,green] at (2.5,{g(2.5)}){} ;

\stopaxis
\stoptikzpicture}}

\input knuth

\stopsection

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 3057 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-10  7:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 17:26 Strange behavior with TikZ Fabrice Couvreur
2017-10-05 20:35 ` Hans Hagen
2017-10-05 20:51   ` Fabrice Couvreur
2017-10-07 10:17     ` Fabrice Couvreur
2017-10-07 12:40       ` Aditya Mahajan
2017-10-07 12:44         ` Aditya Mahajan
2017-10-07 13:59           ` Hans Hagen
2017-10-07 21:48             ` Fabrice Couvreur
2017-10-10  7:03             ` luigi scarso

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).