余分な余白を削除する

余分な余白を削除する

あちこちで見つかったデータから、計算されたデータから曲線を描くプロジェクトを改造しました。出力ファイルに問題があります。余白が多すぎるか、少なくとも情報のない白い領域があります。興味のある部分、つまりすべての詳細 (軸と軸のタイトル) を含むグラフのみを保持できるようにしたいと思います。図の全体的なフレームのサイズを示す線がどこにあるかわかりません。線を変更しようとしました\begin{tikzpicture}\begin{tikzpicture}(0,0)(10,10)、何も変わりません。

アドバイスがあれば歓迎します (結果として得られる PDF をクロスカットするという残酷な方法は取りたくないのです)。

グラフ

コード :

\documentclass[border=0.5cm, 11pt]{standalone}

\usepackage{dosageAB}
\usepackage{pgfplots}\pgfplotsset{compat=newest}


\begin{document}

\titragepHlAFBF{titrage Acide fort par base forte}{1}{0.013}{10}{0.01}

\end{document}

それに付随する sty ファイル:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dosageAB}


\RequirePackage[utf8x]{inputenc}    
\RequirePackage{graphicx,subfigure}
\RequirePackage{pdfpages}
\RequirePackage{multicol}
\RequirePackage{multirow}               %package qui permet de fusionner cellules d'un tableau

\RequirePackage[french]{babel}
\RequirePackage{float}
\RequirePackage{array}

%lien url

\RequirePackage{hyperref}

%perso puces
\RequirePackage{enumitem}
\frenchbsetup{StandardLists=true}

%item
\RequirePackage{xcolor}


%boîte colorée
\RequirePackage{tcolorbox}

\RequirePackage[a4paper,DIV=12]{typearea}


%encadrement formules
\RequirePackage{amsmath}
\RequirePackage{siunitx}
\RequirePackage{ucs}

%lignes en pointillés
\RequirePackage{multido}


\RequirePackage{csvsimple}

%

%marge
\RequirePackage{marginnote}
\RequirePackage{geometry}
% boîtes arrondies compétences
\RequirePackage{fancybox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%image Tikz
%%%%%%%%%%%%%%%%%%%%%%%%%%

\RequirePackage{tikz}
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{decorations.markings}
\tikzstyle arrowstyle=[scale=1]
\tikzstyle directed=[postaction={decorate,decoration={markings,mark=at position .65 with {\arrow[arrowstyle]{stealth}}}}]
\tikzstyle reverse directed=[postaction={decorate,decoration={markings,mark=at position .65 with {\arrowreversed[arrowstyle]{stealth};}}}]
\RequirePackage{pgfplots}

\sisetup{locale = FR,detect-all}


%commande affichage directlua
\newcommand{\pdl}[1]{
\directlua{tex.sprint(#1)}
}

%définition incrément autour de l'équivalence

\def\inc{0.0125}

%%commande Titrage Acide Fort par une base Forte en ligne continue

\newcommand{\titragepHlAFBF}[5]{

\def\CA{#3} \def\VA{#4} \def\CB{#5} 
\pgfmathsetmacro{\negativeLogCa}{-log10(\CA)}


\directlua{
VE=\CA*\VA/\CB
VEinf=VE-\inc
VEsup=VE+\inc
pH0=-math.log(\CA)/math.log(10)
ysup=14+math.log((\CA*\VA)/(\VA+VEsup))/math.log(10)+math.log(\CB*VEsup/(\CA*\VA)-1)/math.log(10)
yinf=-math.log((\CA*\VA)/(\VA+VEinf))/math.log(10)-math.log(1-(\CB*VEinf/(\CA*\VA)))/math.log(10)
a=(ysup-yinf)/(VEsup-VEinf)
b=ysup-a*VEsup
}

\def\VE{\pdl{VE}}
\def\VEinf{\pdl{VEinf}}
\def\VEsup{\pdl{VEsup}}
\def\a{\pdl{a}}
\def\b{\pdl{b}}
\def\pHinit{\pdl{pH0}}

\begin{tikzpicture}


\begin{axis}[% mise en forme du graphique :
    xmin=0,xmax=25,
    ymin=0,ymax=14,
    xlabel=volume $ V_b $ versé (mL),
    ylabel=pH,
    ytick distance=2,
    minor y tick num=1,% nombre de graduations secondaires intermédiaires
    minor x tick num=4,% nombre de graduations secondaires intermédiaires
    grid,
    grid=both,% grilles primaire et secondaire
    axis line shift=3pt,
    xtick align=outside,
    ytick align=outside,
    tickpos=left,
 samples=101,
    ]

%\addplot+ coordinates{(0,\pHinit)};

\addplot [domain=0:\VEinf,color=blue] {-ln((\CA*\VA)/(\VA+x))/ln(10)-ln(1-(\CB*x/(\CA*\VA)))/ln(10)};

\addplot [domain=\VEinf:\VEsup,color=blue] {\a*x+\b};

\addplot [domain=\VEsup:25,color=blue] {14+ln((\CA*\VA)/(\VA+x))/ln(10)+ln(\CB*x/(\CA*\VA)-1)/ln(10)};


 \coordinate (equiv) at (\VE,7);
 \draw[magenta, dashed, thick] (0,7) node[above right, font=\scriptsize \ssfamily]{pH=7}-- (equiv) -- (\VE,0)node[above right, font=\scriptsize \ssfamily]{$V_{eq}=\qty{\VE}{\ml}$} ;
\filldraw[magenta] (equiv) circle(1pt) node[right, font=\scriptsize \ssfamily]{équivalence};
\end{axis}

\end{tikzpicture}
}

関連情報