Open NebIAms opened 10 months ago
I encountered the same issue. I tracked it down to the noautotitle
tag. Adding notitle
or an empty title
directly on the plot elements didn't fix it for me.
For me always the first plotted line was omitted, when the legend was shown.
In fact this seems like a bug in the gnuplot, because when I do manually paste the commands into it, the same result appears.
I created an issue at the gnuplot repository: https://sourceforge.net/p/gnuplot/bugs/2691/
Bug category
Describe the bug When a legend is added, the lines on a plot do not always appear. I think this problem is specific to the operating system and compiler.
Steps to Reproduce From the examples, copy the one with 4 cosine functions. https://alandefreitas.github.io/matplotplusplus/appearance/labels/legend/
Then compile the code: cl /Fomain.obj /c main.cpp /TP /nologo /std:c++latest /EHsc /MD "/IC:\Program Files\Matplot++ 1.2.0\include" main.cpp link /nologo /OUT:example.exe "/LIBPATH:C:\Program Files\Matplot++ 1.2.0\lib" Gdi32.lib user32.lib Shell32.lib matplot.lib Matplot++/nodesoup.lib main.obj
This is the plot I usually get, sometimes I get a few lines, sometimes all of them:
If I comment out the code that adds the legend I always get:
Output (When legend is enabled)
(process:20880): Pango-WARNING **: 15:36:07.420: couldn't load font "Helvetica Not-Rotated 2200", falling back to "Sans Not-Rotated 2200", expect ugly output.
Platform
Environment Details:
Additional context Installed GNU plot, tried to install a font called Helvetica, not sure how to get the one for the library to not produce that warning. I have tried to add other text, such as a title and axes labels, those work fine.