In Matlab, the following generates a black color on the specified line in the legend:
leftAxis = sprintf('left y-axis','Color','r');
leg = legend([.. bla bla ..], sprintf('test [%s]', leftAxis), etc... );
What I'm trying to achieve is two colors on the same line in the legend. (so in this example the part 'test' should be black and the part 'left y-axis' should be red.
What I've tried:
- Doing the above: no result.
- Getting the string arguments from the legend and altering the color: colors the whole line.
- Using LaTeX to color the text: no result.
A picture to visualise what I mean:
Probably you mistyped tex string:
Generates: