Solución:
€ dit³
Una sugerencia con pgfplots:
Creo que quieres algo así …
· Un método está configurando extra x ticks
, ver “T_0+T_1
“; mismo juego con”K
” mediante el uso extra y ticks
.
· Otro método es agregar etiquetas especiales como draw
anotación, ver “T_0
“,”T_1
” y “T_a
“,”T_b
“:
Si desea utilizar diferentes longitudes de tick para sus etiquetas, puede preferir el segundo método.
A continuación se muestran ambas formas.
documentclass[border=5pt, tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=newest}
usetikzlibrary{backgrounds}
begin{document}
pgfdeclarelayer{foreground}
pgfsetlayers{background,main,foreground}
begin{tikzpicture}
pgfmathsetlengthmacroMajorTickLength{
pgfkeysvalueof{/pgfplots/major tick length}*0.5}
pgfmathsetlengthmacroAxisShift{-4.5pt}
begin{axis}[
xmin=-0,
xmax=6.0,
ymin=0,
ymax=4.5,
%axis lines=middle,
axis y line=middle,
axis x line=bottom,
axis line style={-, gray},
major tick length=MajorTickLength,
every tick/.style={gray},
tick align=outside,
y axis line style={xshift=AxisShift},
every y tick/.style={xshift=AxisShift},
yticklabel style={xshift=AxisShift},
x axis line style={yshift=AxisShift},
every x tick/.style={yshift=AxisShift},
x tick label style={yshift=AxisShift, fill=white},
ylabel={rotatebox{90}{$y
xlabel={$t$},
x label style={at={(ticklabel* cs:0.975)}, inner sep=5pt, yshift=4*AxisShift, anchor=north},
y label style={at={(ticklabel* cs:0.55)}, inner sep=5pt, xshift=3.5*AxisShift, anchor=east},
xtick={0,...,6},
ytick={1,...,4},
extra y ticks={0,4.5},
extra y tick labels={0,$K$},
grid=major,
extra x ticks={2},
extra x tick labels={$T_0 + T_1$},
extra x tick style={major tick length=-5.25*AxisShift, on background layer},
%enlarge y limits={abs=0.4,upper},
]
% Curve
addplot [domain=1.5:6, samples=222, thick]{9/2 *(1 -exp(3 -2*x)};
% Line 1 as parametric plot
addplot[dashed, variable=t, samples=2, thick]({2},{t}) ;
% Line 2 as table-plot
addplot[no marks, thick,] table[x=X,y=Y] {
X Y
1.5 0
2 4.5
};
% Some special labels ===================
begin{pgfonlayer}{foreground}
foreach T/Name in {0.5/T_1, 1.5/T_0, 3.85/T_a, 4.6/T_b} {edeftemp{noexpand
draw [gray, yshift=AxisShift] (T,0) -- (T,2.75*AxisShift) node[below, text=black, inner sep=2pt]{$Name$};
}temp}
end{pgfonlayer}
% ================================
end{axis}
end{tikzpicture}
end{document}
Esto hace algo por el estilo. Para que una marca adicional no elimine la anterior, necesita el /.list
clave. Para evitar superposiciones, puede utilizar turnos. Tan en conjunto
major also at/.list={ 1.5 as $T_0$,
2 as [node style={yshift=-2em}] $T_0 + T_1$},
MWE completo:
documentclass{scrartcl}
usepackage{tikz}
usetikzlibrary{datavisualization.formats.functions}
begin{document}
begin{tikzpicture}
datavisualization[
scientific axes={clean},
all axes = grid,
x axis = {
min value = 0,
ticks = {
major also at/.list={ 1.5 as $T_0$,
2 as [node style={yshift=-2em,alias=pft}] $T_0 + T_1$},
stack
},
label = $t$
},
y axis = {
min value = 0,
ticks = {major = {also at = 4.5 as $K$}},
label = $y
},
visualize as smooth line/.list = {
curve,
line 1,
line 2
},
line 2 = {style = dashed}
]
data[
set = curve,
format = function
] {
var x : interval[1.5 : 6];
func y = 9/2 * (1 - exp(3 - 2 * value x));
}
data[set = line 1] {
x, y
1.5, 0
2, 4.5
}
data[set = line 2] {
x, y
2, 4.5
2, 0
};
draw[very thin] (pft.north) -- ++ (0,1em);
end{tikzpicture}
end{document}
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)