1

I'm trying to draw, in a T=f(x) plane graphic, a curve passing through four points whose coordinates have been obtained experimentally. The x axis range is 0 to 0.5, the y axis range is 0 to 80. This is my attempt

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
  a4paper,
  margin=15mm,
  bindingoffset=2mm,
  heightrounded,
]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{xcolor}
\usepgfplotslibrary{external}
\tikzexternalize
\definecolor{verde}{HTML}{00C200}
\definecolor{gold}{HTML}{FFBF18}
\pgfplotsset{width=7cm,compat=1.14}


\begin{document}
\begin{flushleft}
\begin{tikzpicture}

\begin{axis}[

     width=12cm,
     %axis y line=center, 
     %axis x line=middle,
     xmin=0, xmax=0.5, 
     ymin=0, ymax=80,
     xlabel=x,
     ylabel=T(°C),
     xmajorgrids=true,
     ymajorgrids=true,
    grid style=dashed,
    ]

    \addplot+[scatter,color=black,ultra thick]
    coordinates {
    (0.31,63.5)(0.20,35.8)(0.10,30.1)(0.05,31.9)
    };
\end{axis}
\end{tikzpicture}

\end{flushleft}
\end{document}

I'm using MiKtex with Texmaker. I get this error message:

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interaction=batchmode -jobname "LdCF1-figure0" "\def\tikzexternalrealjob{LdCF1}\input{LdCF1}"' did NOT result in a usable output file 'LdCF1-figure0' (expected one of.pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. Forpdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'LdCF1-figure0.log'. If you continue now, I'll try to typeset the picture.See the tikz package documentation for explanation.Type H for immediate help.... \end{tikzpicture}

Can you help me?

Thank you in advance

1

Do you really need pgfplots for this?

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
  a4paper,
  margin=15mm,
  bindingoffset=2mm,
  heightrounded,
]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{xcolor}
\usepgfplotslibrary{external}
\tikzexternalize
\definecolor{verde}{HTML}{00C200}
\definecolor{gold}{HTML}{FFBF18}
\pgfplotsset{width=7cm,compat=1.14}
\usepackage{siunitx}

\begin{document}
\begin{flushleft}
\begin{tikzpicture}[x=24cm,y=0.1cm,>=stealth]
\draw[->] (0,0) -- (0.5,0) node[below] {$x$};
\draw[->] (0,0) -- (0,80) node[left] {$T\si{\celsius}$};
\draw plot[smooth] coordinates {(0.31,63.5)(0.20,35.8)(0.10,30.1)(0.05,31.9)};
\end{tikzpicture}
\end{flushleft}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.