|
From: Elias A. <eli...@gm...> - 2015-05-17 20:13:44
|
Hi List, In gnuplot 5.0 using the pdfcairo terminal, a superscript in a key entry shifts that entries baseline. Compare the following two plots: set term pdf font ",20" set out "test.pdf"; p 1 t 'X', 2 t 'Y^y', 3 t 'X', 4 t 'Y', 5 t 'X'; set out Is there a way to disable or work around this shift? I would like to avoid it because (1) the resulting different line spacings just look ugly, and (2) it shifts the text relative to the line sample. Thanks, Elias |
|
From: Tatsuro M. <tma...@ya...> - 2015-05-22 02:33:06
|
----- Original Message ----- > From: Elias Assmann > To: gnuplot-info > Cc: > Date: 2015/5/18, Mon 05:13 > Subject: [Gnuplot-info] pdfcairo: superscript in legend shifts text baseline > > Hi List, > > In gnuplot 5.0 using the pdfcairo terminal, a superscript in a key entry > shifts that entries baseline. Compare the following two plots: > > set term pdf font ",20" > set out "test.pdf"; p 1 t 'X', 2 t 'Y^y', 3 t > 'X', 4 t 'Y', 5 t 'X'; set out > > Is there a way to disable or work around this shift? I would like to > avoid it because (1) the resulting different line spacings just look > ugly, and (2) it shifts the text relative to the line sample. > > Thanks, > > Elias Did you try to run the same script for other cairo based terminals? (Wxt, pngcairo and epscairo ) Tatsuro |
|
From: Elias A. <eli...@gm...> - 2015-05-22 08:31:33
|
Tatsuro, On 05/22/2015 04:32 AM, Tatsuro MATSUOKA wrote: > Did you try to run the same script for other cairo based terminals? > (Wxt, pngcairo and epscairo ) Yes, I tried pngcairo. I did not see the different line separations there. Do you see the same behavior I am seeing? Note that I would not consider this a bug per se. It can be useful to automatically change the line spread when there are sub- or superscripts. (Whether it makes sense to do this for a single line could be debated.) Just that in my case, it looks awful, and I would like to change it. Elias PS: Really, wxt is cairo-based? I did not know that. |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2015-05-22 17:09:38
|
Am 22.05.2015 um 10:31 schrieb Elias Assmann: > Note that I would not consider this a bug per se. It can be useful to > automatically change the line spread when there are sub- or > superscripts. (Whether it makes sense to do this for a single line > could be debated.) Well, underscores need space, so something has to make way. I'd say that only can this be useful, it is necessary. It would be a bug not to do it. > Just that in my case, it looks awful, and I would > like to change it. You may want to use the "spacing" option. See "help key samples" |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2015-05-22 17:25:20
|
Am 22.05.2015 um 19:09 schrieb Hans-Bernhard Bröker: > Am 22.05.2015 um 10:31 schrieb Elias Assmann: >> Note that I would not consider this a bug per se. It can be useful to >> automatically change the line spread when there are sub- or >> superscripts. (Whether it makes sense to do this for a single line >> could be debated.) > > Well, underscores need space, so something has to make way. Ooops, s/underscores/superscripts/ |
|
From: Elias A. <eli...@gm...> - 2015-05-23 21:03:49
|
On 05/22/2015 07:09 PM, Hans-Bernhard Bröker wrote: > Am 22.05.2015 um 10:31 schrieb Elias Assmann: >> Note that I would not consider this a bug per se. It can be useful to >> automatically change the line spread when there are sub- or >> superscripts. (Whether it makes sense to do this for a single line >> could be debated.) > > Well, underscores need space, so something has to make way. I'd say > that only can this be useful, it is necessary. It would be a bug not to > do it. Yes, this is basically what I meant as well. But it is not what happens; looking at the plots I just sent in another post, no extra space is added. And the shift is not in proportion to the height added by the superscript. In fact, I changed my mind: I would argue that this is clearly a bug (whether in gnuplot or cairo, I have no idea). I agree with you that adding extra space make sense, but I am not sure that a shift does. Maybe it would be better to keep the alignment between text baseline and line sample constant. (Consider two legend entries “X” and “x”. Would you expect the baseline of “X” to be lower than that of “x”?) And of course, if you do shift, it should be in proportion to the extra height. It is not so bad with the default font, but quite noticeable with the Carlito font. Also, the vertical placement of the text in Carlito seems wrong. Maybe that is related? > > Just that in my case, it looks awful, and I would >> like to change it. > > You may want to use the "spacing" option. See "help key samples" Thanks, but ‘spacing’ changes the spacing between all lines. If anything, I would need a per-line option. By the way, one of the first things I tried to solve this problem was a phantom superscript “X^@”, but that does not change anything. Is there a way to make a phantom with nonzero height? Elias |
|
From: Tatsuro M. <tma...@ya...> - 2015-05-22 11:17:40
|
----- Original Message ----- > From: Elias Assmann > To: Tatsuro MATSUOKA ; gnuplot-info> Cc: > Date: 2015/5/22, Fri 17:31 > Subject: Re: [Gnuplot-info] pdfcairo: superscript in legend shifts text baseline > >T atsuro, > > On 05/22/2015 04:32 AM, Tatsuro MATSUOKA wrote: >> Did you try to run the same script for other cairo based terminals? >> (Wxt, pngcairo and epscairo ) > > Yes, I tried pngcairo. I did not see the different line separations > there. Do you see the same behavior I am seeing? > > Note that I would not consider this a bug per se. It can be useful to > automatically change the line spread when there are sub- or > superscripts. (Whether it makes sense to do this for a single line > could be debated.) Just that in my case, it looks awful, and I would > like to change it. > > > Elias > > PS: Really, wxt is cairo-based? I did not know that. Elias I have tested on pdfcairo, pngcairo and wxt terminal on gnuplot 5.1 (cvs, 2015-05-19) (windows version) and upload a zip archived file. http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0064 0064 test.zip, 105,699 bytes, 2015-05-22, zip archived test files on cairobased terminals on gnuplot 5.1 The file test.zip inculdes test.pdf produced by your script. test.png produced by your script slightly modified for pngcairo wxt.png screen shot of wxt terminal by your script slightly modified for wxt I cannot find the difference of three images. > PS: Really, wxt is cairo-based? I did not know that.| Yes. The wxt terminal uses cairo and pango libraries internally like other cairo based terminals. Tatsuro |
|
From: Elias A. <eli...@gm...> - 2015-05-23 20:30:46
|
On 05/22/2015 01:17 PM, Tatsuro MATSUOKA wrote: > I have tested on pdfcairo, pngcairo and wxt terminal on gnuplot 5.1 > (cvs, 2015-05-19) (windows version) and upload a zip archived file. > > http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0064 > > 0064 test.zip, 105,699 bytes, 2015-05-22, zip archived test files on > cairobased terminals on gnuplot 5.1 Thank you. Meanwhile, I have also done some more analysis, using three variables: terminal (png/pdf), font (default font / Carlito), and gnuplot version (4.6 / 5.0). Carlito <http://www.tug.dk/FontCatalogue/carlito/> is the font I use in the plot that originally led me to post. With wxt, I get the same results as with pdfcairo. First, in the png terminal I do not see the effect. All the legend entries are identically vertically aligned w.r.t. their lines. (Compare nosuper.png and default-5.0.png.) With the pdf terminal, the superscripted legend entry is placed further down. The space between legend lines is not changed. (Compare nosuper.pdf and default-5.0.pdf.) The shift is larger in 4.6 than in 5.0. The effect also seems larger with Carlito than with the default font. What is more, with the default font, the legend text (without superscripts) is approximately centered vertically w.r.t. the line. But for some reason, when using Carlito, it is considerably off-center. In your plots, I see the same behavior in the pdf and wxt versions, but curiously enough, the shift also happens in your png version. You can find my plots at <ftp://ftp.tugraz.at/outgoing/assmann/baseline.zip>: * {carlito,default}*: plots as mentioned above * ruler-*: same, with rulers added for clarity * nosuper.*: without any superscripts * optcond_origu.pdf: this is my “real” plot; I think this is actually a better illustration of the problem than the simple test Elias |
|
From: Tatsuro M. <tma...@ya...> - 2015-05-23 22:20:13
|
> From: Elias Assmann > To: Tatsuro MATSUOKA; gnuplot-info > Cc: > Date: 2015/5/24, Sun 05:30 > Subject: Re: [Gnuplot-info] pdfcairo: superscript in legend shifts text baseline > > On 05/22/2015 01:17 PM, Tatsuro MATSUOKA wrote: >> I have tested on pdfcairo, pngcairo and wxt terminal on gnuplot 5.1 >> (cvs, 2015-05-19) (windows version) and upload a zip archived file. >> >> http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0064 >> >> 0064 test.zip, 105,699 bytes, 2015-05-22, zip archived test files on >> cairobased terminals on gnuplot 5.1 > > Thank you. Meanwhile, I have also done some more analysis, > using three variables: terminal (png/pdf), font (default font / > Carlito), and gnuplot version (4.6 / 5.0). Carlito > <http://www.tug.dk/FontCatalogue/carlito/> is the font I use in the plot > that originally led me to post. With wxt, I get the same results as > with pdfcairo. > > First, in the png terminal I do not see the effect. All the legend > entries are identically vertically aligned w.r.t. their lines. (Compare > nosuper.png and default-5.0.png.) > > With the pdf terminal, the superscripted legend entry is placed further > down. The space between legend lines is not changed. (Compare > nosuper.pdf and default-5.0.pdf.) The shift is larger in 4.6 than in 5.0. > > The effect also seems larger with Carlito than with the default font. What is > more, with the default font, the legend text (without superscripts) is > approximately centered vertically w.r.t. the line. But for some reason, when > using Carlito, it is considerably off-center. > > In your plots, I see the same behavior in the pdf and wxt versions, but > curiously enough, the shift also happens in your png version. > > You can find my plots at > <ftp://ftp.tugraz.at/outgoing/assmann/baseline.zip>: > > * {carlito,default}*: plots as mentioned above > * ruler-*: same, with rulers added for clarity > * nosuper.*: without any superscripts > * optcond_origu.pdf: this is my “real” plot; I think this is actually a better > illustration of the problem than the simple test Elias I did not understand what you mean correctly. OK. The same behaviors should be expected on the different terminals concerning baseline. Please file to bug ticket with the files you prepared. The bug ticket allows attachment file. > In your plots, I see the same behavior in the pdf and wxt versions, but > curiously enough, the shift also happens in your png version. It is not curious. As I wrote, I have made png image by pngcairo terminal but not png terminal. set term png => png terminal based on libgd set term pngcairo => pngcairo terminal based on libcairo and libpango. Note that "set term pdf" behaves in special way. 1. If the original pdf terminal based on pdflib exists, "set term pdf" points to the original one. 2. If the original pdf terminal based on pdflib does not exist but the pdfcairo terminal exist, "set term pdf" means the same as "set term pdfcairo". The gnuplot windows binaries distributed on the SourceForge and on my personal site (5.1 cvs)[1], the original pdf terminal does not exist. Then "set term pdf" is the same as "set term pdfcairo". This is because the free version of pdflib is not easy to obtained in current situation. [1] http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/ Tatsuro |
|
From: Elias A. <eli...@gm...> - 2015-05-24 11:58:24
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/24/2015 12:20 AM, Tatsuro MATSUOKA wrote: > Please file to bug ticket with the files you prepared. The bug > ticket allows attachment file. Ok, I can do that (if there is some agreement that this is in fact a bug …). > set term png => png terminal based on libgd set term pngcairo => > pngcairo terminal based on libcairo and libpango. Oops, you are right. I did use the ‘png’ terminal instead of ‘pngcairo’, sorry. ‘pngcairo’ seems to behave in the same way as ‘pdfcairo’. > The gnuplot windows binaries distributed on the SourceForge and on > my personal site (5.1 cvs)[1], the original pdf terminal does not > exist. Then "set term pdf" is the same as "set term pdfcairo". Same in my binary (self-compiled on Ubuntu). Elias -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJVYbzTAAoJEE/4gtQZfOqPb9oP/j/S+Fi0mWtrjRlpjgKjXni3 MiUODl1P5wQhq2Dc+mzryFQw+r0tloIG1pHGcZTeHEk5tDrlPj8xTGYHZdzFy1LP bXHu/0rXmZ5yRfZVTsQCy4ZOWA7/kPWrl19MAAcUC59uEBFm7Ym++L/cazl/89ei WCNodlGiou1yG9Umd+KuCZNMJGhYo+/I+E42q34eq8YZE2Fo8xnQkPlFslqcof7B WLGyuwjp/ZM0wKrcHz0CWfzGGXmTQcA8dcXjD4e8J+zWVVBSCgHg7IhCYdYKlBOo 9ZDphFM8PG9SvzUvV24xIUtS2iVxgrZTvSaQTsxwtyoTy1UhNjDSoDthIcn1TRFQ SirJ/BXHXpEZVOnPozdnp4+wB+TznF38w1ROWLopTv2K/aFRBLF7X3UI0zsylpOh Sti3fjNNQ7gNyQ6Q90QsjjqEFuTkHmmDxXb4UyFsjFN6WiqThZTN9LtpIh4v9Dao RKLsPnC5lfZg0RCV5vi34hT0vu3mxqEXhxj9k5DPCep6y5ghB9qkAVPZ5Ovf8gvJ vahi/SQVh911hqhyOtVI8VSjr2vVRYkwAeR8zAhAiSsiyoKrQ55eFaPVeIl6SJCP COAZqeJn8Z+uT9Fw7T2mET3qEjgbTPUJPAF1R6H80sAnbyaRBDzGsdu0wJStXa9U m2whObrPreEXcbq/A2aT =QnC2 -----END PGP SIGNATURE----- |
|
From: Ethan A M. <eam...@gm...> - 2015-05-24 05:26:08
|
On Saturday, 23 May 2015 10:30:34 PM Elias Assmann wrote: > On 05/22/2015 01:17 PM, Tatsuro MATSUOKA wrote: > > I have tested on pdfcairo, pngcairo and wxt terminal on gnuplot 5.1 > > (cvs, 2015-05-19) (windows version) and upload a zip archived file. > > > > http://www.geocities.co.jp/tmgpltwin/Files/Files.html#0064 > > > > 0064 test.zip, 105,699 bytes, 2015-05-22, zip archived test files on > > cairobased terminals on gnuplot 5.1 > > Thank you. Meanwhile, I have also done some more analysis, > using three variables: terminal (png/pdf), font (default font / > Carlito), and gnuplot version (4.6 / 5.0). Carlito > <http://www.tug.dk/FontCatalogue/carlito/> is the font I use in the plot > that originally led me to post. With wxt, I get the same results as > with pdfcairo. > > First, in the png terminal I do not see the effect. All the legend > entries are identically vertically aligned w.r.t. their lines. (Compare > nosuper.png and default-5.0.png.) > > With the pdf terminal, the superscripted legend entry is placed further > down. The space between legend lines is not changed. (Compare > nosuper.pdf and default-5.0.pdf.) The shift is larger in 4.6 than in 5.0. > > The effect also seems larger with Carlito than with the default font. > What is more, with the default font, the legend text (without > superscripts) is approximately centered vertically w.r.t. the line. But > for some reason, when using Carlito, it is considerably off-center. > > In your plots, I see the same behavior in the pdf and wxt versions, but > curiously enough, the shift also happens in your png version. > > You can find my plots at > <ftp://ftp.tugraz.at/outgoing/assmann/baseline.zip>: I do not know why you are seeing this with the cairo terminals. It doesn't seem to happen when the same test script is processed by qt. Regardless of the reason, I suspect that a work-around is to append '^ ' (carat+space) at the end of all key titles. That should trigger the same allowance for superscript space consistently while not actually printing anything extra. Ethan > > * {carlito,default}*: plots as mentioned above > * ruler-*: same, with rulers added for clarity > * nosuper.*: without any superscripts > * optcond_origu.pdf: this is my “real” plot; I think this is actually > a better illustration of the problem than the simple test > > > Elias |
|
From: Elias A. <eli...@gm...> - 2015-05-24 13:01:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/24/2015 07:25 AM, Ethan A Merritt wrote: > I do not know why you are seeing this with the cairo terminals. It > doesn't seem to happen when the same test script is processed by > qt. I can confirm that. To be precise, in qt the shift of the superscripted text seems “correct” in relation to the added height. When using the Carlito font, the vertical alignment of the non-superscripted text with the line samples is also better than in wxt. qt: http://i.imgur.com/z0ZedPu.png vs. http://i.imgur.com/863GY6j.png wxt: http://i.imgur.com/9somASG.png vs. http://i.imgur.com/xFxMmGY.png > Regardless of the reason, I suspect that a work-around is to > append '^ ' (carat+space) at the end of all key titles. That should > trigger the same allowance for superscript space consistently while > not actually printing anything extra. That is what I was looking for! Using this trick, I could solve my problem. Thank you. Elias -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJVYcuKAAoJEE/4gtQZfOqPw0sP/3qkzJH6SnaRXCNDYQ73kiHS R2WnM1mOXVcLmhdmEnEW7FwYzHYkOd9fAgDT/kUhKLjzBwPzeV8rQ4dHVBV5vcqr nylDCjhEFdl1y6l1VuotVNGuBoXjCtri1qxop2/q/ZbDQ7u4J6FZ2gOkTy39tpvS MY7Q0P/t5VLw2Dr5Mrc11T+ad45qnUBubuOft1c8B0iyH4CMmN235wk5s/w0jZrZ 0bcuNWVkN5rWO4AnynXfjZHedLmGDPkZYeautFdjHXQguSWxdXTac0DQi8LONxoS QfRLsK2z029qeXWry4JVozmg2cdEd4rsEcClYwU8XO0gi2cqgGrbNq0/bF7BP9z/ ccRtDrnupVBa/hu6PIfLPYg/vmcMI/dc6qLkiW7TOrazSxL0H+YnnQhf3YbOmizF jDf/lXGMywFAAbevdh1uo15pDGp1ZKgFDGoxLbcI0Ovn0iyYBSz3EpCpCwqFUB+o Zq7n9o1G+b+7v+zcqk/os1cuj4937uZUAlja1z41WgB7CKmQjT+v6vdOL5wk8ikw TNCS+RUG8YdRPmmjEGr/0ZYU2Nz7yzW6D297U9zCwH66OZp/DGfLCj9ywcKdqfm4 iYryDIZNspkmb+4T8WEOl5naDNiI41MDmXtd467nGc7xT9vMAJsTkmVnKqbesvoL 8RUdZ04Br1aJ/A9oA9hn =imiP -----END PGP SIGNATURE----- |