Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a legend seems to cause lines to not appear on line plot, Windows, MSVC #385

Open
2 of 8 tasks
NebIAms opened this issue Dec 29, 2023 · 2 comments
Open
2 of 8 tasks

Comments

@NebIAms
Copy link

NebIAms commented Dec 29, 2023

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:
image

If I comment out the code that adds the legend I always get:
image

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.

@DNKpp
Copy link

DNKpp commented Feb 20, 2024

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.

@DNKpp
Copy link

DNKpp commented Feb 21, 2024

I created an issue at the gnuplot repository: https://sourceforge.net/p/gnuplot/bugs/2691/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants