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

[BUG] Incorrect display of negative signs in tick labels with non-default fonts in PDF outputs #4929

Open
singularitti opened this issue May 5, 2024 · 0 comments
Labels
bug GR upstream julia or dependencies

Comments

@singularitti
Copy link
Contributor

singularitti commented May 5, 2024

Details

When using any non-default fonts available in the GR framework with the plot function, the negative signs (-) in the tick labels on both the x and y axes are incorrectly displayed as question marks (?). This issue occurs specifically when saving plots as PDF files. Saving the same plots as PNG files shows the negative signs correctly, indicating that the issue is isolated to PDF outputs.

Steps to Reproduce

  1. Install and load the Plots package.
  2. Set gr() as the backend.
  3. Execute the following plotting commands using various non-default fonts:
    using Plots
    gr()
    plot(-4:4, -5:3; fontfamily="Palatino Roman")  # Change font as needed
    xlabel!("-x")
    ylabel!("-y")
    savefig("x.pdf")  # Save as PDF and observe the issue
    savefig("x.png")  # Save as PNG for comparison
  4. Open both x.pdf and x.png to view the results.

PDF

PNG

Expected Result

The tick labels with negative numbers should correctly display the negative sign in both PDF and PNG outputs.

Actual Result

In PDF outputs, the negative signs in the tick labels are replaced with question marks (?). In PNG outputs, the negative signs are displayed correctly.

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot
plotlyjs
pgfplotsx
unicodeplots
inspectdr
gaston

Versions

Plots.jl version: v1.40.4
Backend version (]st -m <backend(s)>): v0.73.5
Output of versioninfo():

Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
@BeastyBlacksmith BeastyBlacksmith added GR upstream julia or dependencies labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug GR upstream julia or dependencies
Projects
None yet
Development

No branches or pull requests

2 participants