1

In my plot, there are 6-7 \addplot[] entries but I want legend for only one of those functions. How can I do that? I tried \addlegendentry after the function I wish to have a legend for but it creates a legend corresponding to the first one.

Werner
  • 603,163
  • Hi Baptu88, welcome to the site! You can add forget plot to the plots that you want to exclude from the legend. – Jake Feb 03 '14 at 06:29
  • I solved it by including legend entries={My Function} and \addlegendimage{no markers, mycolor} in the \begin axis[] part. – sm176357 Feb 03 '14 at 06:57
  • That also works. You have to be aware that with that approach, the style of the plot and the legend entry aren't linked any more, so if you change the color of the plot, the legend won't automatically reflect that. – Jake Feb 03 '14 at 07:25

0 Answers0