Adding a legend seems to cause lines to not appear on line plot, Windows, MSVC
NebIAms opened this issue · 2 comments
Bug category
- bug - compilation error
- bug - compilation warning
- bug - runtime error
- bug - runtime warning
- bug - logic error
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
- cross-platform issue - linux
- cross-platform issue - windows
- cross-platform issue - macos
Environment Details:
- OS: Windows 10
- OS Version: 10.0.19045 Build 19045
- Compiler: MSVC (cl)
- Compiler version: 19.38.33133
- Linker version: 14.38.33133.0
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.
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/