Dégradé radial avec Tikz

Tout ce qui concerne l'utilisation ou l'installation de LaTeX.

Modérateur: gdm_tex

Règles du forum
Merci d'éviter le style SMS dans vos messages et de penser à utiliser la fonction Recherche avant de poster un message. Pour joindre des fichiers à vos messages, consulter ce sujet.
> Penser à utiliser les balises Code pour poster du code.

Dégradé radial avec Tikz

Messagepar evariste_G » Mercredi 10 Juin 2009, 18:39

Bonjour.

Le code suivant :

Code: Tout sélectionner
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary[arrows,fadings]

\newcommand{\repere}[3]{ % xmax, ymax, profondeur max
   \tikzfading[name=fade right,left color=transparent!0,right color=transparent!100]
   \tikzfading[name=fade left,left color=transparent!100,right color=transparent!0]
   \pgfmathparse{#3*cos(-135)} \let\X\pgfmathresult
   \pgfmathparse{#3*sin(-135)} \let\Y\pgfmathresult
   \pgfmathparse{2*#1/3} \let\XXr\pgfmathresult
   \pgfmathparse{#1/3} \let\Xr\pgfmathresult
   \pgfmathparse{\Y+#2-0.5} \let\ZZ\pgfmathresult
   \pgfmathparse{#2-0.5} \let\YY\pgfmathresult
   \pgfmathparse{#1-0.3} \let\XX\pgfmathresult
   \pgfmathparse{\X+#1} \let\XXX\pgfmathresult
   \shade [inner color=gray,outer color=white] (0,0) -- (\X,\Y) .. controls (\Xr,-#3) and (\XXr,\Y) .. (#1,0.2) -- cycle; 
   \fill[gray,path fading=fade right] (0,0) rectangle +(#1,\YY);
   \fill[gray,path fading=fade left] (0,0) -- (0,\YY) -- (\X,\ZZ) -- (\X,\Y) -- cycle;
   \draw[->,>=stealth'] (0,0) -- (#1,0);
   \draw[->,>=stealth'] (0,0) -- (0,#2);   
   \draw[->,>=stealth'] (0,0) -- (\X,\Y);     
   \foreach \i in {1,2,...,\YY}
   {
      \pgfmathparse{(#3-0.2)*cos(-135)} \let\ZX\pgfmathresult
      \pgfmathparse{(#3-0.2)*sin(-135)+\i} \let\ZY\pgfmathresult
      \draw[dotted] (\ZX,\ZY) -- (0,\i) -- (\XX,\i);
     
   }
}

\begin{document}
\begin{tikzpicture}
\repere{5}{6}{1}
\end{tikzpicture}
\end{document}


donne :

temp.jpg


Mais je voudrais avoir un dégradé radial du plan xOy (celui du bas) : foncé en O(0,0,0) pour s'éclaircir en s'éloignant du point O (origine du repère). Mais là, le foncé est en plein milieu ... Je n'y arrive pas : arc, ellipse, circle, controls, .. rien n'y fait ...

Quelqu'un sait-il comment faire ?
Mathématiques, LaTeX et Python : http://www.mathweb.fr
Cours particuliers de maths et de NSI : https://cours-particuliers-bordeaux.fr/
evariste_G
Téra-utilisateur
 
Messages: 1427
Inscription: Vendredi 19 Décembre 2008, 19:13
Localisation: Bordeaux
Statut actuel: Actif et salarié | Enseignant

Publicité

Re: Dégradé radial avec Tikz

Messagepar pg » Vendredi 12 Juin 2009, 12:18

Tu peux essayer quelque chose comme cela :

tikz_degrade_radial.png
tikz_degrade_radial.png (8.09 Kio) Vu 2986 fois


Code: Tout sélectionner
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary[arrows,fadings]

\newcommand{\repere}[3]{ % xmax, ymax, profondeur max
   \tikzfading[name=fade right,
      left color=transparent!0,
      right color=transparent!100]
   \tikzfading[name=fade left,
      left color=transparent!100,
      right color=transparent!0]
   \tikzfading[name=fade out,
      inner color=transparent!0,
      outer color=transparent!100]
   \pgfmathparse{#3*cos(-135)} \let\X\pgfmathresult
   \pgfmathparse{#3*sin(-135)} \let\Y\pgfmathresult
   \pgfmathparse{2*#1/3} \let\XXr\pgfmathresult
   \pgfmathparse{#1/3} \let\Xr\pgfmathresult
   \pgfmathparse{\Y+#2-0.5} \let\ZZ\pgfmathresult
   \pgfmathparse{#2-0.5} \let\YY\pgfmathresult
   \pgfmathparse{#1-0.3} \let\XX\pgfmathresult
   \pgfmathparse{\X+#1} \let\XXX\pgfmathresult
   \fill [gray,path fading=fade out,fading transform={xshift=-0.75cm,yshift=0.5cm}] (0,0) -- (\X,\Y) .. controls (\Xr,-#3) and (\XXr,\Y) .. (#1+8cm,0.2) -- cycle;
   \fill[gray,path fading=fade right] (0,0) rectangle +(#1,\YY);
   \fill[gray,path fading=fade left] (0,0) -- (0,\YY) -- (\X,\ZZ) -- (\X,\Y) -- cycle;
   \draw[->,>=stealth'] (0,0) -- (#1,0);
   \draw[->,>=stealth'] (0,0) -- (0,#2);   
   \draw[->,>=stealth'] (0,0) -- (\X,\Y);     
   \foreach \i in {1,2,...,\YY}
   {
      \pgfmathparse{(#3-0.2)*cos(-135)} \let\ZX\pgfmathresult
      \pgfmathparse{(#3-0.2)*sin(-135)+\i} \let\ZY\pgfmathresult
      \draw[dotted] (\ZX,\ZY) -- (0,\i) -- (\XX,\i);
     
   }
}

\begin{document}
\begin{tikzpicture}
\repere{5}{6}{1}
\end{tikzpicture}
\end{document}
pg
Modérateur
 
Messages: 2593
Inscription: Jeudi 14 Juin 2007, 23:31

Re: Dégradé radial avec Tikz

Messagepar evariste_G » Vendredi 12 Juin 2009, 13:13

Merci, ça fonctionne. Cependant, je ne comprends pas trop le rôle de xshift et yshift. En fait, la longueur de l'axe horizontal varie mais la "tâche" grise reste identique donc quand on agrandit l'axe horizontal, j'aimerais bien que le dégradé s'agrandisse aussi ... Je vais bosser sur ça.
Mathématiques, LaTeX et Python : http://www.mathweb.fr
Cours particuliers de maths et de NSI : https://cours-particuliers-bordeaux.fr/
evariste_G
Téra-utilisateur
 
Messages: 1427
Inscription: Vendredi 19 Décembre 2008, 19:13
Localisation: Bordeaux
Statut actuel: Actif et salarié | Enseignant

Re: Dégradé radial avec Tikz

Messagepar projetmbc » Vendredi 12 Juin 2009, 13:50

N'hésites pas à poster une solution ici car cela m'intéresse.
projetmbc
Péta-utilisateur
 
Messages: 1895
Inscription: Samedi 29 Décembre 2007, 00:58
Statut actuel: Actif et salarié | Enseignant

Re: Dégradé radial avec Tikz

Messagepar evariste_G » Vendredi 12 Juin 2009, 14:09

Bon, j'ai un petit peu truandé :

Code: Tout sélectionner
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary[arrows,fadings]
\newcommand{\repere}[3]
{ % xmax, ymax, profondeur max
   \tikzfading[name=fade right,left color=transparent!0,right color=transparent!100]
   \tikzfading[name=fade left,left color=transparent!100,right color=transparent!0]
   \tikzfading[name=fade out,inner color=transparent!0,outer color=transparent!100]
   \pgfmathparse{#3*cos(-135)} \let\X\pgfmathresult
   \pgfmathparse{#3*sin(-135)} \let\Y\pgfmathresult
   \pgfmathparse{4*#1/3} \let\XXr\pgfmathresult
   \pgfmathparse{2*#1/3} \let\Xr\pgfmathresult
   \pgfmathparse{\Y+#2-0.5} \let\ZZ\pgfmathresult
   \pgfmathparse{#2-0.5} \let\YY\pgfmathresult
   \pgfmathparse{#1-0.3} \let\XX\pgfmathresult
   \pgfmathparse{\X+#1} \let\XXX\pgfmathresult
   \pgfmathparse{#1/2} \let\xsh\pgfmathresult
   \pgfmathparse{#3/2} \let\ysh\pgfmathresult
   \fill [gray,path fading=fade out,fading transform={xshift=-0.75 cm,yshift=0.5 cm}] (0,0) -- (\X,\Y) .. controls (\Xr,-#3) and (\XXr,\Y) .. (1.9*#1,0.5) -- cycle;
   \fill[white] (0,0) rectangle +(#1,\YY);
   \fill[gray,path fading=fade right] (0,0) rectangle +(#1,\YY);
   \fill[gray,path fading=fade left] (0,0) -- (0,\YY) -- (\X,\ZZ) -- (\X,\Y) -- cycle;
   \draw[->,>=stealth'] (0,0) -- (#1,0);
   \draw[->,>=stealth'] (0,0) -- (0,#2);   
   \draw[->,>=stealth'] (0,0) -- (\X,\Y);     
   \foreach \i in {1,2,...,\YY}
   {
      \pgfmathparse{(#3-0.2)*cos(-135)} \let\ZX\pgfmathresult
      \pgfmathparse{(#3-0.2)*sin(-135)+\i} \let\ZY\pgfmathresult
      \draw[dotted] (\ZX,\ZY) -- (0,\i) -- (\XX,\i);   
   }
}

\begin{document}
\repere{10}{5}{1}
\end{document}


mais ça marche plutôt pas mal ...
Mathématiques, LaTeX et Python : http://www.mathweb.fr
Cours particuliers de maths et de NSI : https://cours-particuliers-bordeaux.fr/
evariste_G
Téra-utilisateur
 
Messages: 1427
Inscription: Vendredi 19 Décembre 2008, 19:13
Localisation: Bordeaux
Statut actuel: Actif et salarié | Enseignant

Re: Dégradé radial avec Tikz

Messagepar projetmbc » Vendredi 12 Juin 2009, 15:35

Chez moi ton exemple ne fonctionne pas. J'ai le LOG suivant :

Code: Tout sélectionner
LOG FILE :
This is pdfTeX, Version 3.141592-1.40.7 (MiKTeX 2.7) (preloaded format=pdflatex 2009.4.17) 12 JUN 2009 16:31
entering extended mode
**Repere3D_Degrade_Mieux.tex
(Repere3D_Degrade_Mieux.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, french, loaded.
("C:\Program Files\MiKTeX 2.7\tex\latex\base\article.cls"
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
("C:\Program Files\MiKTeX 2.7\tex\latex\base\size10.clo"
File: size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.7\tex\latex\base\inputenc.sty"
Package: inputenc 2006/05/05 v1.1b Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15
("C:\Program Files\MiKTeX 2.7\tex\latex\base\latin1.def"
File: latin1.def 2006/05/05 v1.1b Input encoding file
))
("C:\Program Files\MiKTeX 2.7\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)
("C:\Program Files\MiKTeX 2.7\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\pdftex.def"
File: pdftex.def 2007/06/12 v0.04h Graphics/color for pdfTeX
\Gread@gobject=\count87
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\frontendlayer\tikz.sty"
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\basiclayer\pgf.sty"
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\utilities\pgfrcs.sty"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\utilities\pgfutil-common.tex"
\pgfutil@everybye=\toks16
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\utilities\pgfutil-latex.def")
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\utilities\pgfrcs.code.tex"
Package: pgfrcs 2008/02/20 v2.00 (rcs-revision 1.21)
))
Package: pgf 2008/01/15 v2.00 (rcs-revision 1.12)
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\basiclayer\pgfcore.sty"
("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks17
)
("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\graphics.sty"
Package: graphics 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.7\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files\MiKTeX 2.7\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 90.
)
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\systemlayer\pgfsys.sty"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgfsys.code.tex"
Package: pgfsys 2008/02/07 v2.00 (rcs-revision 1.31)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\utilities\pgfkeys.code.tex"
\pgfkeys@pathtoks=\toks18
\pgfkeys@temptoks=\toks19
)
\pgf@x=\dimen105
\pgf@y=\dimen106
\pgf@xa=\dimen107
\pgf@ya=\dimen108
\pgf@xb=\dimen109
\pgf@yb=\dimen110
\pgf@xc=\dimen111
\pgf@yc=\dimen112
\c@pgf@counta=\count88
\c@pgf@countb=\count89
\c@pgf@countc=\count90
\c@pgf@countd=\count91
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgf.cfg"
File: pgf.cfg 2008/01/13 (rcs-revision 1.6)
)
Package pgfsys Info: Driver file for pgf: pgfsys-pdftex.def on input line 885.
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgfsys-pdftex.def"
File: pgfsys-pdftex.def 2007/12/20 (rcs-revision 1.20)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgfsys-common-pdf.def
"
File: pgfsys-common-pdf.def 2007/12/17 (rcs-revision 1.8)
)))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgfsyssoftpath.code.t
ex"
File: pgfsyssoftpath.code.tex 2008/01/23 (rcs-revision 1.6)
\pgfsyssoftpath@smallbuffer@items=\count92
\pgfsyssoftpath@bigbuffer@items=\count93
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\systemlayer\pgfsysprotocol.code.t
ex"
File: pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
)) ("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcore.code.tex"
Package: pgfcore 2008/01/15 v2.00 (rcs-revision 1.6)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmath.code.tex"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathcalc.code.tex"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathutil.code.tex"
\pgfmath@box=\box26
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathparser.code.tex"
\pgfmath@stack=\toks20
\c@pgfmath@parsecounta=\count94
\c@pgfmath@parsecountb=\count95
\c@pgfmath@parsecountc=\count96
\pgfmath@parsex=\dimen113
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathoperations.code.tex"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathtrig.code.tex")
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathrnd.code.tex"))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\math\pgfmathbase.code.tex")))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorepoints.code.tex
"
File: pgfcorepoints.code.tex 2008/02/03 (rcs-revision 1.13)
\pgf@picminx=\dimen114
\pgf@picmaxx=\dimen115
\pgf@picminy=\dimen116
\pgf@picmaxy=\dimen117
\pgf@pathminx=\dimen118
\pgf@pathmaxx=\dimen119
\pgf@pathminy=\dimen120
\pgf@pathmaxy=\dimen121
\pgf@xx=\dimen122
\pgf@xy=\dimen123
\pgf@yx=\dimen124
\pgf@yy=\dimen125
\pgf@zx=\dimen126
\pgf@zy=\dimen127
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorepathconstruct.c
ode.tex"
File: pgfcorepathconstruct.code.tex 2008/02/13 (rcs-revision 1.14)
\pgf@path@lastx=\dimen128
\pgf@path@lasty=\dimen129
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorepathusage.code.
tex"
File: pgfcorepathusage.code.tex 2008/01/23 (rcs-revision 1.11)
\pgf@shorten@end@additional=\dimen130
\pgf@shorten@start@additional=\dimen131
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorescopes.code.tex
"
File: pgfcorescopes.code.tex 2008/01/15 (rcs-revision 1.26)
\pgfpic=\box27
\pgf@hbox=\box28
\pgf@layerbox@main=\box29
\pgf@picture@serial@count=\count97
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoregraphicstate.co
de.tex"
File: pgfcoregraphicstate.code.tex 2007/12/12 (rcs-revision 1.8)
\pgflinewidth=\dimen132
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoretransformations
.code.tex"
File: pgfcoretransformations.code.tex 2008/02/04 (rcs-revision 1.10)
\pgf@pt@x=\dimen133
\pgf@pt@y=\dimen134
\pgf@pt@temp=\dimen135
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorequick.code.tex"
File: pgfcorequick.code.tex 2006/10/11 (rcs-revision 1.2)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoreobjects.code.te
x"
File: pgfcoreobjects.code.tex 2006/10/11 (rcs-revision 1.2)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorepathprocessing.
code.tex"
File: pgfcorepathprocessing.code.tex 2008/01/23 (rcs-revision 1.7)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorearrows.code.tex
"
File: pgfcorearrows.code.tex 2007/06/07 (rcs-revision 1.8)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoreshade.code.tex"
File: pgfcoreshade.code.tex 2007/12/10 (rcs-revision 1.9)
\pgf@max=\dimen136
\pgf@sys@shading@range@num=\count98
) ("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoreimage.code.te
x"
File: pgfcoreimage.code.tex 2008/01/15 (rcs-revision 1.1)
\pgfexternal@startupbox=\box30
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorelayers.code.tex
"
File: pgfcorelayers.code.tex 2008/01/15 (rcs-revision 1.1)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcoretransparency.co
de.tex"
File: pgfcoretransparency.code.tex 2008/01/17 (rcs-revision 1.2)
)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\basiclayer\pgfcorepatterns.code.t
ex"
File: pgfcorepatterns.code.tex 2008/01/15 (rcs-revision 1.1)
)))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\modules\pgfmoduleshapes.code.tex"
File: pgfmoduleshapes.code.tex 2008/02/13 (rcs-revision 1.4)
\pgfnodeparttextbox=\box31
\toks@savedmacro=\toks21
) ("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\modules\pgfmoduleplot.code.tex"
File: pgfmoduleplot.code.tex 2008/01/15 (rcs-revision 1.1)
\pgf@plotwrite=\write3
)
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\compatibility\pgfcomp-version-0-65.
sty"
Package: pgfcomp-version-0-65 2007/07/03 v2.00 (rcs-revision 1.7)
\pgf@nodesepstart=\dimen137
\pgf@nodesepend=\dimen138
)
("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\compatibility\pgfcomp-version-1-18.
sty"
Package: pgfcomp-version-1-18 2007/07/23 v2.00 (rcs-revision 1.1)
)) ("C:\Program Files\MiKTeX 2.7\tex\latex\pgf\utilities\pgffor.sty"
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\utilities\pgffor.code.tex"
Package: pgffor 2007/11/07 v2.00 (rcs-revision 1.8)
\pgffor@iter=\dimen139
\pgffor@skip=\dimen140
))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\frontendlayer\tikz\tikz.code.tex"
Package: tikz 2008/02/13 v2.00 (rcs-revision 1.27)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\libraries\pgflibraryplothandlers.
code.tex"
File: pgflibraryplothandlers.code.tex 2007/03/09 v2.00 (rcs-revision 1.9)
\pgf@plot@mark@count=\count99
\pgfplotmarksize=\dimen141
)
\tikz@lastx=\dimen142
\tikz@lasty=\dimen143
\tikz@lastxsaved=\dimen144
\tikz@lastysaved=\dimen145
\tikzleveldistance=\dimen146
\tikzsiblingdistance=\dimen147
\tikz@figbox=\box32
\tikz@tempbox=\box33
\tikztreelevel=\count100
\tikznumberofchildren=\count101
\tikznumberofcurrentchild=\count102
\tikz@fig@count=\count103
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\modules\pgfmodulematrix.code.tex"
File: pgfmodulematrix.code.tex 2008/01/15 (rcs-revision 1.1)
\pgfmatrixcurrentrow=\count104
\pgfmatrixcurrentcolumn=\count105
\pgf@matrix@numberofcolumns=\count106
)
\tikz@expandcount=\count107
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
librarytopaths.code.tex"
File: tikzlibrarytopaths.code.tex 2008/01/09 v2.00 (rcs-revision 1.1)
)))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
libraryarrows.code.tex"
File: tikzlibraryarrows.code.tex 2008/01/09 v2.00 (rcs-revision 1.1)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\libraries\pgflibraryarrows.code.t
ex"
File: pgflibraryarrows.code.tex 2007/06/07 v2.00 (rcs-revision 1.7)
))
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\frontendlayer\tikz\libraries\tikz
libraryfadings.code.tex"
File: tikzlibraryfadings.code.tex 2008/01/09 v2.00 (rcs-revision 1.1)
("C:\Program Files\MiKTeX 2.7\tex\generic\pgf\libraries\pgflibraryfadings.code.
tex"
File: pgflibraryfadings.code.tex 2008/02/07 v2.00 (rcs-revision 1.3)
))
No file Repere3D_Degrade_Mieux.aux.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 36.
LaTeX Font Info: ... okay on input line 36.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 36.
LaTeX Font Info: ... okay on input line 36.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 36.
LaTeX Font Info: ... okay on input line 36.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 36.
LaTeX Font Info: ... okay on input line 36.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 36.
LaTeX Font Info: ... okay on input line 36.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 36.
LaTeX Font Info: ... okay on input line 36.
("C:\Program Files\MiKTeX 2.7\tex\context\base\supp-pdf.tex"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count108
\scratchdimen=\dimen148
\scratchbox=\box34
\nofMPsegments=\count109
\nofMParguments=\count110
\everyMPshowfont=\toks22
\MPscratchCnt=\count111
\MPscratchDim=\dimen149
\MPnumerator=\count112
\everyMPtoPDFconversion=\toks23
)
! Missing number, treated as zero.
<to be read again>
[
l.37 \repere{10}{5}{1}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
[
l.37 \repere{10}{5}{1}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
[
l.37 \repere{10}{5}{1}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
[
l.37 \repere{10}{5}{1}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
[
l.37 \repere{10}{5}{1}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
[
l.37 \repere{10}{5}{1}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
[
l.37 \repere{10}{5}{1}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
[
l.37 \repere{10}{5}{1}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Undefined control sequence.
\repere ...\X ,\ZZ ) -- (\X ,\Y ) -- cycle; \draw
[->,>=stealth'] (0,0) -- (...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\repere ...[->,>=stealth'] (0,0) -- (#1,0); \draw
[->,>=stealth'] (0,0) -- (...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\repere ...[->,>=stealth'] (0,0) -- (0,#2); \draw
[->,>=stealth'] (0,0) -- (...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgffor@body ...i } \let \ZY \pgfmathresult \draw
[dotted] (\ZX ,\ZY ) -- (0...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgffor@body ...i } \let \ZY \pgfmathresult \draw
[dotted] (\ZX ,\ZY ) -- (0...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgffor@body ...i } \let \ZY \pgfmathresult \draw
[dotted] (\ZX ,\ZY ) -- (0...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgffor@body ...i } \let \ZY \pgfmathresult \draw
[dotted] (\ZX ,\ZY ) -- (0...
l.37 \repere{10}{5}{1}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Overfull \hbox (1.63976pt too wide) in paragraph at lines 37--38
[]\OT1/cmr/m/n/10 [gray,path fad-ing=fade out,fading transform=xshift=-0.75 cm,
yshift=0.5 cm]
[]
Overfull \hbox (20.73238pt too wide) in paragraph at lines 37--38
\OT1/cmr/m/n/10 (0,0) -- (-0.7071,-0.7071) .. con-trols (6.66666,-1) and (13.33
333,-0.7071) .. (1.9*10,0.5)
[]
Overfull \hbox (0.42676pt too wide) in paragraph at lines 37--38
\OT1/cmr/m/n/10 rect-an-gle +(10,4.5); [gray,path fad-ing=fade left] (0,0) -- (
0,4.5) -- (-0.7071,3.7929)
[]
[1
{C:/Documents and Settings/All Users/Application Data/MiKTeX/2.7/pdftex/config/
pdftex.map}] (Repere3D_Degrade_Mieux.aux) )
Here is how much of TeX's memory you used:
7481 strings out of 95337
132545 string characters out of 1184077
186312 words of memory out of 1500000
10561 multiletter control sequences out of 110000
3640 words of font info for 14 fonts, out of 1200000 for 2000
14 hyphenation exceptions out of 8191
47i,7n,61p,362b,547s stack positions out of 5000i,500n,10000p,200000b,5000s
<C:/Program Files/MiKTeX 2.7/fonts/t
ype1/bluesky/cm/cmr10.pfb>
Output written on Repere3D_Degrade_Mieux.pdf (1 page, 12468 bytes).
PDF statistics:
35 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 131072)
145 words of extra memory for PDF output out of 10000 (max. 10000000)
projetmbc
Péta-utilisateur
 
Messages: 1895
Inscription: Samedi 29 Décembre 2007, 00:58
Statut actuel: Actif et salarié | Enseignant

Re: Dégradé radial avec Tikz

Messagepar evariste_G » Vendredi 12 Juin 2009, 17:51

Oui, j'ai oublié de mettre \repere{}{}{} dans l'environnement \tikz :

Code: Tout sélectionner
    \documentclass[10pt,a4paper]{article}
    \usepackage[latin1]{inputenc}
    \usepackage{xcolor}
    \usepackage{tikz}
    \usetikzlibrary[arrows,fadings]
    \newcommand{\repere}[3]
    { % xmax, ymax, profondeur max
       \tikzfading[name=fade right,left color=transparent!0,right color=transparent!100]
       \tikzfading[name=fade left,left color=transparent!100,right color=transparent!0]
       \tikzfading[name=fade out,inner color=transparent!0,outer color=transparent!100]
       \pgfmathparse{#3*cos(-135)} \let\X\pgfmathresult
       \pgfmathparse{#3*sin(-135)} \let\Y\pgfmathresult
       \pgfmathparse{4*#1/3} \let\XXr\pgfmathresult
       \pgfmathparse{2*#1/3} \let\Xr\pgfmathresult
       \pgfmathparse{\Y+#2-0.5} \let\ZZ\pgfmathresult
       \pgfmathparse{#2-0.5} \let\YY\pgfmathresult
       \pgfmathparse{#1-0.3} \let\XX\pgfmathresult
       \pgfmathparse{\X+#1} \let\XXX\pgfmathresult
       \pgfmathparse{#1/2} \let\xsh\pgfmathresult
       \pgfmathparse{#3/2} \let\ysh\pgfmathresult
       \fill [gray,path fading=fade out,fading transform={xshift=-0.75 cm,yshift=0.5 cm}] (0,0) -- (\X,\Y) .. controls (\Xr,-#3) and (\XXr,\Y) .. (1.85*#1,0.5) -- cycle;
       \fill[white] (0,0) rectangle +(#1+1,\YY);
       \fill[gray,path fading=fade right] (0,0) rectangle +(#1,\YY);
       \fill[gray,path fading=fade left] (0,0) -- (0,\YY) -- (\X,\ZZ) -- (\X,\Y) -- cycle;
       \draw[->,>=stealth'] (0,0) -- (#1,0);
       \draw[->,>=stealth'] (0,0) -- (0,#2);   
       \draw[->,>=stealth'] (0,0) -- (\X,\Y);     
       \foreach \i in {1,2,...,\YY}
       {
          \pgfmathparse{(#3-0.2)*cos(-135)} \let\ZX\pgfmathresult
          \pgfmathparse{(#3-0.2)*sin(-135)+\i} \let\ZY\pgfmathresult
          \draw[dotted] (\ZX,\ZY) -- (0,\i) -- (\XX,\i);   
       }
    }

    \begin{document}
    \begin{tikzpicture}
       \repere{10}{5}{1}
    \end{tikzpicture}
    \end{document}
Mathématiques, LaTeX et Python : http://www.mathweb.fr
Cours particuliers de maths et de NSI : https://cours-particuliers-bordeaux.fr/
evariste_G
Téra-utilisateur
 
Messages: 1427
Inscription: Vendredi 19 Décembre 2008, 19:13
Localisation: Bordeaux
Statut actuel: Actif et salarié | Enseignant

Re: Dégradé radial avec Tikz

Messagepar projetmbc » Vendredi 12 Juin 2009, 20:23

Merci c'est nickel.
projetmbc
Péta-utilisateur
 
Messages: 1895
Inscription: Samedi 29 Décembre 2007, 00:58
Statut actuel: Actif et salarié | Enseignant


Retourner vers LaTeX

 


  • Articles en relation
    Réponses
    Vus
    Dernier message

Qui est en ligne

Utilisateurs parcourant ce forum: Google [Bot], Google Adsense [Bot], Grapeshot [Crawler] et 17 invités