[Thread Prev][Thread Next][Index]

Re: [ferret_users] Strange bug in plot title with html features



Hi Olivier,

Thank you for the report.  My guess is that the code which centers the text is not correctly taking into account the size of the title with the subscript.  It is making a calculation to do that, but perhaps isn't getting this right with different fonts.

Just to verify we are seeing the same thing, try this script.  Do you see the amount of shifting shown in the attached plot?

SET TEXT/FONT=calibri/color=black
SET VIEW UL ; PLOT/TITLE="d18O text text text"                   I[I=1:10] ! Title OK
SET VIEW UR ; PLOT/TITLE="d<sup>18</sup>O text text text"        I[I=1:10] ! Title shifted to the right
SET VIEW LL ; PLOT/TITLE="<&delta><sup>18</sup>O text text text" I[I=1:10] ! Title shifted to the right
SET VIEW LR ; PLOT/TITLE="<&delta>18O text text text"            I[I=1:10] ! Title OK

! viewports starting slightly higher.
! Draw labels without subscript to see the shift

define view/x=0:0.5/y=0.02:0.5 ll2
define view/x=0.5:1/y=0.02:0.5 lr2
define view/x=0:0.5/y=0.52:1 ul2
define view/x=0.5:1/y=0.52:1 ur2

set text/font=calibri/color=blue

SET VIEW UL2 ; PLOT/TITLE="d18O text text text"   
SET VIEW UR2 ; PLOT/TITLE="d18O text text text"  
SET VIEW LL2 ; PLOT/TITLE="d18O text text text"  
SET VIEW LR2 ; PLOT/TITLE="d18O text text text" 

On 4/29/2020 1:55 AM, Olivier Marti wrote:
In the following script, some plots have a title that is not centered, but shifted to the right. It happens when a <sup> syntax is used.

Do you have the same problem ? And could you suggest a workaround ?

(tested with pyferret 7.5 on MacOSX and on Linux)

Olivier

!
! Strange behaviour ...
! The plot title is shifted to the right when a syntax <sup>foo</sup> is used

SET TEXT/FONT=calibri

SET VIEW UL ; PLOT/TITLE="d18O text text text"                   I[I=1:10] ! Title OK
SET VIEW UR ; PLOT/TITLE="d<sup>18</sup>O text text text"        I[I=1:10] ! Title shifted to the right
SET VIEW LL ; PLOT/TITLE="<&delta><sup>18</sup>O text text text" I[I=1:10] ! Title shifted to the right
SET VIEW LR ; PLOT/TITLE="<&delta>18O text text text"            I[I=1:10] ! Title OK

— 
Olivier Marti  - LSCE Bât 714 p. 1049
MERMAID Team
Normal situation :  +33 1 69 08 77 27 
Corona lockdown  :  +33 6 45 36 43 74

-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.

Attachment: titles.png
Description: PNG image


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement