I have a complex figure made with an epslatex terminal in gnuplot. It is a multiplot figure with four panels. In each panel I draw three curves (for three different values of a parameter) and then I superimpose another curve for another parameter on top of each curve. I can distinguish the first parameter with different types of points, and the second one with color.
So, I use the key to distinguish the different points and I would need to have another kind of key for the two colors. Then I use a label with colored text. The point is, the text does not get colored in the epslatex terminal!
I have
set terminal epslatex color solid 8
and
set label 10 'H' tc lt 1 at 0.01,6
This way I get the 'H' label in black. If I use
set terminal epslatex color colortext solid 8
it gives me the error
Package color not loaded in conjunction with terminal option `colourtext'.
Any idea what's the problem?
You can use the \texcolor
command, provided by color
package. If you use standalone
mode color
package is automatically loaded with color
option to terminal, otherwise you have to explicitly load color
(or xcolor
) package in your LaTeX document.
A colorful example:
set terminal epslatex color solid 8 standalone
set output "foo.tex"
set format x '$\textcolor{green}{%g}$'
set format y '$\textcolor{yellow}{%g}$'
set label 10 '\textcolor{blue}{H}' at 0.01,6
plot x**3 title '$\textcolor{magenta}{x}^{\textcolor{cyan}{3}}$'
set output
Result:
Using the colortext
option works, but as the error message says, you must include the color
package in your document. If you use the standalone
option, this is done automatically. So the following works fine:
set terminal epslatex color colortext standalone
set output 'foo.tex'
set label 'lt 1' tc lt 1 at graph 0.2,0.5
set label 'blue' tc rgb 'blue' at graph 0.7,0.5
plot x
There is no need to use the \textcolor
macro explicitely unless you want different colors in one label.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With