Daniele86″ post=50948Se qualcuno conosce un modo per creare una legenda unica dica pure.
Penso di aver trovato una soluzione.
Riporto la soluzione che ho adottato, il codice non è molto ordinato e si potrebbe ottimizzare ma per ora va bene così:
`\documentclass[]{standalone}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage[]{pgfplots}
\pgfplotsset{/pgf/number format/use comma,compat=newest}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{title style={at={(0.5,1.07)}}}
\pgfplotsset{every axis legend/.append style={at={(0.5,1.01)},anchor=south}}
\begin{axis} [ scale only axis,
axis y line*=left,
grid=major,
xlabel={Data e ora},
ylabel={Velocità down-load (Mib)},
title={\textbf{Rilievo velocità internet}},
width=10cm, height=7cm]
\addplot+ [thick,cyan,smooth] file {data_down.txt};
\label{Dplot}
\end{axis}
\begin{axis} [ scale only axis,
axis x line=none,
axis y line*=right,
ylabel={Velocità up-load (Mib)},
width=10cm, height=7cm,
legend style={draw=none},
legend cell align=left,
legend columns={2}]
\addlegendimage{/pgfplots/refstyle=Dplot}\addlegendentry{Down-load}
\addplot+ [thick,orange,smooth,mark=*,mark options={fill=red}] file{data_up.txt};
\addlegendentry{Up-load}
\end{axis}
\end{tikzpicture}
\end{document}`
[attachment=921]Grafico_latex.pdf[/attachment]
[attachment=922]Grafico_latex.tex[/attachment]
[attachment=923]data_up.txt[/attachment]
[attachment=924]data_down.txt[/attachment]