Skip to content

Add unicode multiplot#120

Merged
pjaap merged 30 commits intomainfrom
feature/unicode-multiplot
Apr 22, 2026
Merged

Add unicode multiplot#120
pjaap merged 30 commits intomainfrom
feature/unicode-multiplot

Conversation

@pjaap
Copy link
Copy Markdown
Member

@pjaap pjaap commented Apr 16, 2026

To achieve this, we need to set the size of the subplots and hand over independent Gridvisualizers for the subplots

Results look promising:
image

Need to check if the changes break anything with the other Plotters

@pjaap pjaap force-pushed the feature/unicode-multiplot branch from 49d522b to 7e7d38b Compare April 17, 2026 11:06
@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 17, 2026

I adjusted the total resolutions a bit and I think the result is now very nice:

image

@pjaap pjaap force-pushed the feature/unicode-multiplot branch from a069588 to 9943b08 Compare April 17, 2026 11:53
@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 17, 2026

rebased.

@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 17, 2026

Now also with correct text colors

image

@pjaap pjaap changed the title WIP: Add unicode multiplot Add unicode multiplot Apr 17, 2026
@chmerdon
Copy link
Copy Markdown
Member

Very nice. While we are at it, I added a provisoric vectorplot. It needs some more tweaking with the arrow heads and tails and color customizations, but seems to work in principle. One can test it with the returned plot from Example201 in ExtendableFEM. However, reveal(plt) currently does not work, but show(plt) allows a peak.

@chmerdon
Copy link
Copy Markdown
Member

Maybe it is better to use unicode arrow characters (and color them according to their strength) instead to try to draw real arrows. However, that probably restricts the direction accuracy to 45 degree steps...

@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 22, 2026

Long journey towards the end:

This is Ex101 from ChargeTransport.jl: (slightly modified the code there to precompute x/y limits)

grafik

compared to PythonPlot:
grafik

We have now correct scalings and colors.

What is missing (in UnicodePlots)

  • no marker support
  • line styles (I tried to emulate :dash etc by mixing the color with grey, but this did not work)
  • there is a bug in the y-axis for custom scaling functions (I added a :symlog)

@j-fu
Copy link
Copy Markdown
Member

j-fu commented Apr 22, 2026

Starts looking reasonable!

I usually test things by running (well, yes, we neede some developer docs for this...)

julia> using GridVisualize
julia> import XXXPlots
julia> default_plotter!(XXXPlots)
julia> includet("examples/plotting.jl")
julia> plotting_multiscene()

Two issues emerge in a quick check:

  • How unicode plots handles RGB color values ? Ist there somewhere a projection of RGB onto what unicodeplots can handle
  • May be we should define "empty" dispatches for sclarplot3d etc. (as e.g. exist for Plots)

@j-fu j-fu mentioned this pull request Apr 22, 2026
@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 22, 2026

@j-fu thanks for the hint. plot_multiscene does look good now. And UnicodePlots is now also tested.

@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 22, 2026

Plot looks nice:
grafik

@j-fu: this image should probably put into the README?

@pjaap pjaap force-pushed the feature/unicode-multiplot branch from 268021d to 6690e97 Compare April 22, 2026 11:48
@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 22, 2026

rebased.

@pjaap
Copy link
Copy Markdown
Member Author

pjaap commented Apr 22, 2026

This is the current state:

grafik

I think we are ready for merging. Thanks a lot @chmerdon !

@pjaap pjaap merged commit 9785f0b into main Apr 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants