Re: [Risolto] Riempimento area tra curve con pgfplots

#57519
robitex
Amministratore del forum
    Up
    0
    Down
    ::


    Ecco il grafico con solo la fascia arancione:
    Regola bene i coefficienti che moltiplicano le espressioni delle curve, devono essere gli stessi per tutti grafici.
    Adesso credo che tu sappia fare tutti i grafici che ti servono della sequenza.
    Saluti.

    `\documentclass[11pt,a4paper]{report}

    \usepackage[T1]{fontenc}
    \usepackage[latin1]{inputenc}
    \usepackage{layaureo}

    \usepackage{pgfplots}
    \pgfplotsset{compat=1.3}
    \pgfplotsset{compat=newest}
    \pgfkeys{/pgf/number format/.cd,fixed,precision=2}
    \pgfplotsset{grid style={gray!35}}

    \pgfplotsset{
    mysmall/.style={
    /pgfplots/grid=major,
    /pgfplots/xminorgrids=true,
    /pgfplots/xtick align=outside,
    /pgfplots/ytick align=outside,
    every axis y label/.style=
    {at={(ticklabel cs:0.5)},anchor=near ticklabel},
    legend style={font=\tiny},
    /pgfplots/legend cell align=left,
    /pgfplots/tick label style={font=\scriptsize}
    }
    }

    \begin{document}
    \begin{tikzpicture}%
    \begin{semilogyaxis}[mysmall,
    width=.6\textwidth,
    height=.8\textwidth,
    xlabel={$x$},
    ylabel={$y$},
    xmin=0.1,
    xmax=0.4,
    ymin=1E-6,
    ymax=1,
    domain=0.1:0.4,
    no markers,
    clip=false
    ]

    \addplot[fill,color=orange] {1} \closedcycle;
    \addplot[fill,color=white]
    {(12.659*x^3-8.3636*x^2+2.1229*x+0.0108)*1.06}
    \closedcycle;

    % main red curve
    \addplot[line width=1pt,color=red]
    {12.659*x^3-8.3636*x^2+2.1229*x+0.0108};

    % main blue curve
    \addplot[line width=1pt,color=blue]
    {0.1564*x^2+0.035*x-0.0003};

    % rebuilding of the box line
    \draw (axis description cs:0,0) rectangle
    (axis description cs:1,1);

    % rebuilding of the grid line
    \newcommand{\vl}[1]{%
    \draw[help lines,thin,black!25]
    (axis cs:#1,1E-6)–(axis cs:#1,1)}
    \vl{0.15};
    \vl{0.20};
    \vl{0.25};
    \vl{0.30};
    \vl{0.35};

    \node at (axis cs:.25,0.4) {\footnotesize Primo modello};
    \node at (axis cs:.25,0.055) {\footnotesize Secondo modello};
    \node at (axis cs:.25,2E-4) {\footnotesize terzo modello};
    \end{semilogyaxis}
    \end{tikzpicture}
    \end{document}`

    Go to top