I just started using gnuplot code inside my latex document and I just ran into a problem I could not solve after some googling (hit me if I did not google hard enough). I use the gnuplottex package.
The thing I want to do is multiple plots in my latex document with gnuplot. As some plots treat of related data, I want to use the same colors/linestyle for related data (in this case color). As I am lazy, I just want to declare once the color I want to use in hexacode in LaTex and then use it in every gnuplot command.
For instance:
\documentclass[12pt, a4]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[url=false, doi=false, isbn=false, sorting=none,style=numeric,maxbibnames=3,maxcitenames=3,backend=bibtex]{biblatex}
\usepackage{gnuplottex}
\newcommand{\myredcolor}{\#FF6666}
\begin{document}
And then :
\begin{gnuplot}
set terminal epslatex
plot "mydata" title "\\myredcolor" with linespoints linestyle 1 lt rgb "\\myredcolor" lw 3
\end{gnuplot}
Thing is, obviously, it does not work. In this case, if the plot would appear (ie when putting "red" instead of "\myredcolor" for instance), the title of my plot would correctly be "#FF6666", meaning that I managed to pass my variable gnuplot for the "title" value but not for the rgb value, as the plot won't appear if I leave it like this.
Is there any way to solve this, or will I have to hardcode the hexa value in each of my plot command for this related data ?
Just to try, I also checked for linestyle (in case something was amiss with the # sign) and this wouldn't work either :
\newcommand{\mylinestyle}{1}
And then :
\begin{gnuplot}
set terminal epslatex
plot "mydata" title "MyData \\mylinestyle" with linespoints linestyle \\mylinestyle lt rgb "red" lw 3
\end{gnuplot}
\end{document}
Thanks a lot
