Adobe Acrobat (not the reader, but Pro) allows modifying elements in a pdf quite nicely. However it's a proprietary software.
For a LaTeX hack, I would have tried it this way:
\documentclass{standalone}
\usepackage{graphicx}
\begin{document}
\includegraphics[width = 3in]{figure}%
\hspace{-1.43in}%
\raisebox{2.1in}{%
\includegraphics[width = 1.31in]{legend}%
\hspace{0.1in}}
\end{document}
...of course downloading your two images as png. This gives:

As you see the white space outside the new legend is a bit disturbing. So, there are several things you need to do to get things right for your pdf's.
- trim your new legend from just outside the box.
- change the lengths to suit your case.
It's a trial-and-error method-- somewhat tiresome... but works !
Estimated...notEstiamated. If you have "the correct" legend, why not just recreate the image entirely? – Werner Jan 28 '19 at 03:06nodeonto the imported image and then place the graphics into that node like you normally would\includegraphics[..]{new_legend}. – Werner Jan 28 '19 at 03:15pdfto anepsfile, look for the string there. correct it, and convert back topdf. – Jan 28 '19 at 03:17