On 2023-06-01 at 13:10:39 -0600, Luis Mochan wrote:
> I have a strange bug in PDL::Graphics::Gnuplot. Consider the following 
> program:
> 
>     use PDL;
>     use PDL::Graphics::Gnuplot;
>     use IO::Prompter;
>     $title="A title with many useless letters";
>     gplot({title=>$title}, with=>"lines", zeroes(20)->xvals**2);
>     prompt -void, -single, "Ready?";
> 
> In my system (debian/testing, PDL 2.082, Perl 5.36) the last "s" in
> the title is truncated, as seen in the attached image. My default
> gnuplot terminal is qt. The truncation, if any, depends on the content
> of the title, not only on its length. I can fix it sometimes by adding
> enough trailing whitespace characters. If I generate a hardcopy from
> the 'qt' menu, the title becomes complete again. If I run gnuplot
> interactively, without going through pdl, the title is not
> truncated. It is not too important, but it is annoying, as I sometimes
> use the title to record important parameters.

I am unfortunately not able reproduce this.

Which version of Gnuplot is this? I have:

  $ gnuplot --version
  gnuplot 5.4 patchlevel 4

Does the title become visible if you make the window larger?

How about if you change the font face? This is what I have as my
default:

  $ gnuplot -e 'show term'
    terminal type is qt 0 font "Sans,9"

My guess is that something might be wrong with the font metrics which
ends up clipping the title. You can set both the font and size in
`~/.gnuplot` as:

  set term qt \
          size 1024,1024 \
          font "Courier,16"

so that it does not clutter your scripts.

Finally, would adding newlines to the title be a suitable workaround?
`Text::Wrap` or `Text::Format` could be used to do this automatically.

Cheers,
- Zaki Mughal

> 
> Best regards,
> Luis
> 
> 
> -- 
> 
>                                                                   o
> W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
> Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
> Av. Universidad s/n CP 62210         |                           (*)/\/  \
> Cuernavaca, Morelos, México          | moc...@fis.unam.mx   /\_/\__/
> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB



> _______________________________________________
> pdl-general mailing list
> pdl-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdl-general



_______________________________________________
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to