gnuplot> ss="'A very long string'"; plot x, keyentry @sswarning: ss is not a string variablegnuplot> ss="'A very long string'"; plot x, keyentry ssss only?gnuplot> ss="\"A very long string\""; plot x, keyentry @ssgnuplot> s="'A very long string'"; plot x, keyentry s^unrecognized 'smooth' option
The issue of space allocation is more complicated. A normal key entry has two parts. The sample line segment/box/point/etc that represents the plot and the text given as a title. When gnuplot is predicting the space needed for key it assumes a fixed width for the plot sample and adds the approximate string length of the title text. A
keyentryplot clause also adds two parts to the key. Normally you give a plot style that provides a sample that lines up with other samples in the key and a title that lines up with other titles. If you give a text string in the keyentry instead of a plot style, then that text is placed in the space normally used by the plot sample. A long string probably violates the assumption that all plot samples have the same length. The commands above produce the attached plot.If necessary you can increase the space allocated for the plot sample using the command
set key samplen <value>Ah, I see that I just forgot how do I typically use
keyentry— of course withtitle.But my intent would be naturally much better served with the
rightmodifier (one which you did not show at all, for some reason — but it may be deduced¹⁾ from the docs) — instead of usingtitle! It was not prominent enough in the docs for me to notice…BTW, the docs also say:
But after all my attempts to scan the docs, I cannot find a single place where all this “etc.” stuff is listed. Maybe add a link to such a place there (and in the other “suitable” places)?
BTW², in
help plot titleI do not find the description of modifiersboxed,leftetc. being applicable to the provided string. Are they?The extra text (the part not introduced by
title) can use any of the properties parsed for labels. Seeset label. I have added this to the documentation.