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

Misaligned plots when plotting with UnicodePlots.jl using BrailleCanvas #870

Closed
tmthyln opened this issue Jan 24, 2021 · 5 comments
Closed
Assignees
Labels
frontend Concerning the HTML editor other packages Integration with other Julia packages

Comments

@tmthyln
Copy link

tmthyln commented Jan 24, 2021

Certain plot types from [UnicodePlots.jl] do not plot correctly in Pluto (either using with_terminal() or not), as the characters are unaligned on the right side. This was originally discovered in this Slack thread. We can see the issue just using the examples from the README:

using UnicodePlots
plt = lineplot([-1, 2, 3, 7], [-1, 2, 9, 4], title = "Example Plot", name = "my line", xlabel = "x", ylabel = "y")

image

versus from the REPL:

image

In total, it looks like the following plot types are problematic:

  • lineplot
  • scatterplot
  • stairs
  • spy

(heatmap also doesn't work, but for a different reason relating to color display and not alignment.)

Testing Configuration Details

Tested using Pluto v0.12.18 and UnicodePlots v1.3.0 on Chrome. It turns out Firefox has a similar issue but has a different vertical spacing:

image

This looks to only a problem with the BrailleCanvas and a few spot-checked plots look fine using any of the other canvases.

More Examples

image
image
image

For convenience, here's a Pluto notebook that has the UnicodePlots.jl examples together.

Cause

It looks like for whatever reason the Braille dot-0 (blank) character is being displayed as slightly wider than all the other characters in the browser, misaligning plots that use the BrailleCanvas.

image

@tmthyln
Copy link
Author

tmthyln commented Jan 24, 2021

I have no solution yet1, but I willing to take this on (although I'm currently a bit busy, so it may be a bit of time before I can tackle this).

1 There's the solution of just replacing all dot-0 characters with normal spaces, but I don't know if that would work for all plots without too many special cases, and would probably be more of a PR to UnicodePlots.jl to add a new show method for a new mimetype.

@pankgeorg pankgeorg self-assigned this Jan 24, 2021
@pankgeorg pankgeorg added the accessibility Accessibility improvements of the frontend, like screen reader support and internationalization label Jan 24, 2021
@pankgeorg

This comment has been minimized.

@pankgeorg pankgeorg added frontend Concerning the HTML editor other packages Integration with other Julia packages labels Jan 25, 2021
@pankgeorg
Copy link
Collaborator

pankgeorg commented Jan 25, 2021

The latest version of JuliaMono fixes the issue.

107b0c6
Next release will have it!

@fonsp fonsp removed the accessibility Accessibility improvements of the frontend, like screen reader support and internationalization label Jan 25, 2021
@fonsp fonsp closed this as completed Jan 25, 2021
pankgeorg pushed a commit that referenced this issue Jan 28, 2021
[Diff since v0.12.18](v0.12.18...v0.12.19)

**Closed issues:**
- GPU usage and console messages (#685)
- Feature Proposal: Exported HTML can be passed to a static site generator (#794)
- wait and resume execution on button press (#803)
- Latex code not appropriately displayed (#817)
- Python doesn't work in Pluto (#818)
- add pluto - pluto not found - Julia 1.5.3 macOS (#819)
- Cell output not shown correctly if in-line comment ends with semicolon (#820)
- _llvm (#821)
- Can't move cells (#822)
- Conditions on list comprehensions and execution order (#824)
- Electron app (#825)
- Errors when pressing Ctrl+C to stop Pluto (#827)
- Failed to load notebook error (#829)
- Popup docs don't work for some symbols (#832)
- Running a notebook deleted contents of `.julia/registries` (#834)
- Ctrl+C broken with `julia -e "Pluto.run()"` instead of the REPL (#836)
- Edit or remove default header and footer in exported static PDF (#837)
- Parameters.jl dynamically created macros confuse Pluto (#838)
- Feature request: Open URL from terminal (#840)
- Notebook gets stuck in forever loading state after restarting my PC while running it (#849)
- Syntax highlighting of @. (#854)
- File not found when file newly created while session is running (#855)
- Weird output from a mix of MathJax, Markdown and PlutoUI (#856)
- Misaligned plots when plotting with UnicodePlots.jl using BrailleCanvas (#870)

**Merged pull requests:**
- Pluto ux process file drop (#707) (@pankgeorg)
- Dralbase state managment (#710) (@dralletje)
- PLJ-785 CodeMirror Eject to TextArea - Reload from TextArea in Offline HTML export (#805) (@pankgeorg)
-  Dralbase state managment: Fix front-end tests (#809) (@pankgeorg)
- Update README.md (#814) (@fonsp)
- Regard `:=` in macros as einsum notation (take 2) (#816) (@mcabbott)
- 🧸 Open your own files as samples (#828) (@fonsp)
- Handle filters in generators, closes #824 (#839) (@Pangoraw)
- Update `== nothing` to `=== nothing` in Parse.jl (#841) (@heetbeet)
@cormullion
Copy link
Contributor

cormullion commented Jan 29, 2021

I'm puzzled by this... 😂 I don't remember anything changing in this particular area of the font, and recent tests I did of UnicodePlots hadn't fixed this issue for me personally. I thought it was because the browser didn't render the Braille characters in the same way as the terminals do. But I'm happy if the issue has somehow fixed itself... 😀

Edit - I just realized I've probably been picking up the bundled version of the font rather than the current master which is about 1cm away on the same disk. 😂

@expikr
Copy link

expikr commented Jan 17, 2023

Issue still persists for raw character output.

Raw output:

           ┌────────────────────────────────────────┐       
         1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠚⠉⡏⠓⡄⠀⠀⡠⠚⠉⠉⠲⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ sin(x)
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠁⠀⠀⡇⠀⠈⢆⡜⠁⠀⠀⠀⠀⠙⢄⠀⠀⠀⠀⠀⠀⠀⠀│ cos(x)
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠁⠀⠀⠀⡇⠀⠀⡸⡆⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠃⠀⠀⠀⠀⡇⠀⢰⠁⠘⡄⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠏⠀⠀⠀⠀⠀⡇⢀⠇⠀⠀⠱⡀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⡇⡎⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⠁⠀⠀⠀⠀⠀⠀⡿⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀│
   f(x)    │⠤⠤⠤⠤⣤⠤⠤⠤⠤⠤⠤⢤⠧⠤⠤⠤⠤⠤⠤⢤⡧⠤⠤⠤⠤⠤⠤⠼⡤⠤⠤⠤⠤⠤⠤⠵⠤⠤⠤⠤│
           │⠀⠀⠀⠀⠸⡄⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀⡎⡇⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⣰⠁⠀⠀⠀⠀⠀⠀⡸⠀⡇⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⢇⠀⠀⢠⠇⠀⠀⠀⠀⠀⠀⢠⠃⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠘⡄⢀⡞⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⠀⠸⡜⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀│
           │⠀⠀⠀⠀⠀⠀⢀⡜⠑⣄⠀⠀⠀⠀⢀⡜⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⡀⠀⠀⠀⠀⠀⠀│
        -1 │⠀⠀⠀⠀⣀⡠⠎⠀⠀⠈⠦⣀⣀⡤⠊⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⢄⡀⠀⠀⠀⠀│
           └────────────────────────────────────────┘
           ⠀-4⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀4⠀
           ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀x⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

VSCode:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor other packages Integration with other Julia packages
Projects
None yet
Development

No branches or pull requests

5 participants