Ερώτηση σε tikz

Συντονιστής: grigkost

Άβαταρ μέλους
Tolaso J Kos
Δημοσιεύσεις: 5227
Εγγραφή: Κυρ Αύγ 05, 2012 10:09 pm
Τοποθεσία: Λάρισα, Βαρκελώνη
Επικοινωνία:

Ερώτηση σε tikz

#1

Μη αναγνωσμένη δημοσίευση από Tolaso J Kos » Σάβ Απρ 02, 2016 1:52 pm

Ο παρακάτω κώδικας δίδει το εξής:

Κώδικας: Επιλογή όλων

\documentclass[10pt]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgf,tikz}
\usepackage{tkz-tab}
\usetikzlibrary{fit, shapes,snakes,arrows,intersections, backgrounds}
\usetikzlibrary{scopes,shapes.geometric,shadows}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\draw [->] (-1, 0) -- (2, 0) node[below]{x};
\draw [->] (0, -1) -- (0, 2) node[left]{y};
\draw[scale=0.5,domain=0:2.5,smooth,variable=\x,thick] plot ({\x},{exp(\x-1) -\x +1});
\draw [dashed] (1.26,1.5) -- (1.26, 0);
\draw [dashed] (0, 0.7) -- (1.26, 1.5);
\draw (0, 0) node[left, below]{{\rm O}};
\draw (0, 0.7) node[left]{{\rm A}};
\draw (1.26, 1.5) node[above]{{\rm B}};
\draw (1.26, 0) node[below]{\Gamma};
\end{tikzpicture}
\end{document}
\begin{tikzpicture} 
\draw [->] (-1, 0) -- (2, 0) node[below]{x}; 
\draw [->] (0, -1) -- (0, 2) node[left]{y}; 
\draw[scale=0.5,domain=0:2.5,smooth,variable=\x,thick] plot ({\x},{exp(\x-1) -\x +1}); 
\draw [dashed] (1.26,1.5) -- (1.26, 0); 
\draw [dashed] (0, 0.7) -- (1.26, 1.5); 
\draw (0, 0) node[left, below]{O}; 
\draw (0, 0.7) node[left]{A}; 
\draw (1.26, 1.5) node[above]{B}; 
\draw (1.26, 0) node[below]{\textgreek{Γ}}; 
\end{tikzpicture}

Ερωτήσεις:

1) Πώς μπορώ να χρωματίσω το εμβαδόν που περικλείεται της \mathcal{C}_f , των αξόνων και της κατακόρυφης διακεκομμένης ευθείας; Βρήκα την εντολή \fillbetween αλλά είναι στο pgfplot.

2) Πώς μπορώ να πάω το {\rm O} αριστερά από κει πού είναι; Δοκίμασα το node[below, left] αλλά δε κάνει τίποτα καθώς και το node[below left] αλλά αυτό δε κάνει compile. Παράξενο, διότι το χω δει σε κώδικα.


Η φαντασία είναι σημαντικότερη από τη γνώση !
\displaystyle{{\color{blue}\mathbf{Life=\int_{birth}^{death}\frac{happiness}{time}\Delta time} }}
Άβαταρ μέλους
grigkost
Διαχειριστής
Δημοσιεύσεις: 3053
Εγγραφή: Πέμ Δεκ 18, 2008 12:54 pm
Τοποθεσία: Ιωάννινα
Επικοινωνία:

Re: Ερώτηση σε tikz

#2

Μη αναγνωσμένη δημοσίευση από grigkost » Σάβ Απρ 02, 2016 3:16 pm

Τόλη δοκίμασε με το ίδιο προοίμιο το

Κώδικας: Επιλογή όλων

\begin{tikzpicture}
\draw[line width=0.0pt,color=white,fill=green,fill opacity=0.1, smooth,samples=250,domain=0.0:2.5,scale=0.5] plot(\x,{exp(\x-1.0)-\x+1.0}) -- (2.5,0.) -- (0.,0.) -- cycle;
\draw[line width=1.0pt,color=red, smooth,samples=250,domain=0.0:2.5,scale=0.5] plot(\x,{exp(\x-1.0)-\x+1.0}) ;
\draw [dashed] (1.26,1.5) -- (1.26, 0);
\draw [dashed] (0, 0.7) -- (1.26, 1.5);
\begin{footnotesize}
\draw (0.2, 0) node[left, below]{{\rm O}};
\draw (0, 0.7) node[left]{{\rm A}};
\draw (1.26, 1.5) node[above]{{\rm B}};
\draw (1.26, 0) node[below]{\Gamma};
\draw [->] (-1, 0) -- (2, 0) node[below]{x};
\draw [->] (0, -1) -- (0, 2) node[left]{y};
\end{footnotesize}
\end{tikzpicture}
Θα πρέπει να παράγει την
exp(x-1)-x+1.png
exp(x-1)-x+1.png (12.15 KiB) Προβλήθηκε 2312 φορές


{\color{dred}\Gamma\!\rho\,{\rm{H}}\gamma\varnothing\varrho{\mathscr{H}}\varsigma \ {\mathbb{K}}\,\Omega\sum{\rm{t}}{\mathscr{A}}\,{\mathbb{K}}\!\odot\varsigma
Άβαταρ μέλους
Tolaso J Kos
Δημοσιεύσεις: 5227
Εγγραφή: Κυρ Αύγ 05, 2012 10:09 pm
Τοποθεσία: Λάρισα, Βαρκελώνη
Επικοινωνία:

Re: Ερώτηση σε tikz

#3

Μη αναγνωσμένη δημοσίευση από Tolaso J Kos » Σάβ Απρ 02, 2016 3:41 pm

\begin{tikzpicture} 
\draw [->] (-1, 0) -- (2, 0) node[below]{x}; 
\draw [->] (0, -1) -- (0, 2) node[left]{y}; 
\draw[line width=0pt,color=white,fill=blue,fill opacity=0.6, smooth,samples=250,domain=0:2.5,scale=0.5] plot(\x,{exp(\x-1)-\x+1}) -- (2.5,0) -- (0,0) -- cycle; 
\draw[scale=0.5,domain=0:2.5,smooth,variable=\x,ultra thick, red] plot ({\x},{exp(\x-1) -\x +1}); 
\draw [dashed] (1.26,1.5) -- (1.26, 0); 
\draw [dashed] (0, 0.7) -- (1.26, 1.5); 
\draw (-0.3, 0) node[below]{O}; 
\draw (0, 0.7) node[left]{A}; 
\draw (1.26, 1.5) node[above]{B}; 
\draw (1.26, 0) node[below]{\textgreek{Γ}}; 
\end{tikzpicture}

Ωραία τρέχει. :clap2: :clap2: Ευχαριστώ. Το ξανά πείραξα τον κώδικα για να τον φέρω σύμφωνα με τις ανάγκες μου.

Υ.Σ: Γρηγόρη, αν θέλουμε να ζωγραφίσουμε και το πάνω; Παράδειγμα να το βάλουμε κόκκινο χρώμα; Πώς το φτιάχνουμε;


Η φαντασία είναι σημαντικότερη από τη γνώση !
\displaystyle{{\color{blue}\mathbf{Life=\int_{birth}^{death}\frac{happiness}{time}\Delta time} }}
Άβαταρ μέλους
grigkost
Διαχειριστής
Δημοσιεύσεις: 3053
Εγγραφή: Πέμ Δεκ 18, 2008 12:54 pm
Τοποθεσία: Ιωάννινα
Επικοινωνία:

Re: Ερώτηση σε tikz

#4

Μη αναγνωσμένη δημοσίευση από grigkost » Σάβ Απρ 02, 2016 5:12 pm

Ο κώδικας της tikzpicture:

Κώδικας: Επιλογή όλων

\begin{tikzpicture}
\draw[color=white,fill=gray,fill opacity=0.1,scale=0.5] {[smooth,samples=250,domain=0.0:2.5] plot(\x,{exp(\x-1.0)-\x+1.0})} -- (2.5,2.978) {[smooth,samples=250,domain=2.5:0.0] -- plot(\x,{0.644*\x+1.368})} -- (0.,1.3678794411714423) -- cycle;
\draw[line width=0.0pt,color=white,fill=green,fill opacity=0.1, smooth,samples=250,domain=0.0:2.5,scale=0.5] plot(\x,{exp(\x-1.0)-\x+1.0}) -- (2.5,0.) -- (0.,0.) -- cycle;
\draw[line width=1.0pt,color=red, smooth,samples=250,domain=0.0:2.5,scale=0.5] plot(\x,{exp(\x-1.0)-\x+1.0}) ;
\draw [dashed] (1.26,1.5) -- (1.26, 0);
\draw [dashed] (0, 0.7) -- (1.26, 1.5);
\draw [->] (-1, 0) -- (2, 0) node[below]{x};
\draw [->] (0, -1) -- (0, 2) node[left]{y};
\begin{footnotesize}
\draw (0.2, 0) node[left, below]{{\rm O}};
\draw (0, 0.7) node[left]{{\rm A}};
\draw (1.26, 1.5) node[above]{{\rm B}};
\draw (1.26, 0) node[below]{\Gamma};
\end{footnotesize}
\end{tikzpicture}
πρέπει να δίνει
exp(x-1)-x+1 upper-under-area.png
exp(x-1)-x+1 upper-under-area.png (7.57 KiB) Προβλήθηκε 2253 φορές


{\color{dred}\Gamma\!\rho\,{\rm{H}}\gamma\varnothing\varrho{\mathscr{H}}\varsigma \ {\mathbb{K}}\,\Omega\sum{\rm{t}}{\mathscr{A}}\,{\mathbb{K}}\!\odot\varsigma
Απάντηση

Επιστροφή σε “Πακέτα και γραφή σε TeX-κειμενογράφο”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης