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

html codes not plotted for PS and EPS output #108

Open
pdando opened this issue Feb 26, 2024 · 2 comments
Open

html codes not plotted for PS and EPS output #108

pdando opened this issue Feb 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pdando
Copy link

pdando commented Feb 26, 2024

What happened?

Magics does not plot html codes correctly in title when PS and EPS output is chosen.

What are the steps to reproduce the bug?

This is reproduced using the following Python script (based on Axis example 2):

#importing Magics module
from Magics.macro import *

ref = 'axis2'

#Setting of the output file name
output = output(
                output_formats = ['png','ps','eps','pdf'], 
                output_name_first_page_number = "off",
                output_name = ref
               )

#Setting the cartesian view
projection = mmap(
                  subpage_y_position= 2., 
                  subpage_map_projection = 'cartesian',
                  subpage_x_axis_type = 'date',
                  subpage_y_axis_type = 'regular',
                  subpage_x_date_min = "2012-04-10",
                  subpage_x_date_max = "2012-04-28",
                  subpage_y_min = -20.,
                  subpage_y_max = 20.
                 )

#Vertical axis
vertical = maxis(
                 axis_orientation = "vertical",
                 axis_grid =  "on",
                 axis_type =  "regular",
                 axis_grid_colour = "grey",
                 axis_grid_thickness = 1,
                 axis_grid_reference_level = 0.,
                 axis_grid_reference_line_style='solid',
                 axis_grid_reference_thickness=2,
                 axis_grid_line_style = "dot"
                )

#Horizontal axis
horizontal = maxis(
                   axis_orientation = "horizontal",
                   axis_type =  "date",
                   axis_grid =  "on",
                   axis_days_label_height =  0.4,
                   axis_months_label_height =  0.4,
                   axis_years_label_height =  0.4,
                   axis_grid_colour = "grey",
                   axis_grid_thickness = 1,
                   axis_grid_line_style = "dot"
                  )

lines =["Using time series...for units μm - should be  micrometres with a Greek letter mu"]

title = mtext({
               "text_lines" : lines,
               "text_html" : "true",
               "text_justification": "left",
               "text_font_size": 0.75,
               "text_colour" : "charcoal"
             })

#To the plot
plot(output, projection, vertical, horizontal, title)

Run as:

python3 axis2.py

The title should read:

"Using time series...for units µm - should be micrometres with a Greek letter mu"

This is correct for PNG and PDF output but the "µ" is not printed in the PS or EPS output.

Also fails to print in PS/EPS if tried with HTML decimal (μ), HTML hex (μ;, or as "\u03BC).

See also plots attached to linked ticket MAGP-1343.

Version

4.14.1 and older

Platform (OS and architecture)

Linux ac6-200.bullx 4.18.0-372.52.1.el8_6.x86_64 #1 SMP Fri Mar 31 06:22:44 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux

Relevant log output

No response

Accompanying data

No response

Organisation

ECMWF (reporting on behalf of AEMET)

@pdando pdando added the bug Something isn't working label Feb 26, 2024
@sylvielamythepaut
Copy link
Contributor

Hi Paul,
We will recommend users to consider using the PDF format, do you think they could try ?
Thank you
Sylvie

@pdando
Copy link
Author

pdando commented Mar 7, 2024

Hi Sylvie,

I hope retirement is treating you well ! I see you are still able to provide some Magics support in GitHub !

Of course, I can ask the user to use PDF. Unfortunately, the same user also reported the issue with the Spanish weekday names in #109 which doesn't work with PDF !!

But, if you can solve #109 so that the Spanish (or non-english) weekday names are plotted correctly in PDF then the user should be able to use PDF for everything.

Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants