Plots.jl icon indicating copy to clipboard operation
Plots.jl copied to clipboard

Road to plots 2.0

Open isentropic opened this issue 1 year ago • 14 comments

What changed

  • No default backend
  • Backends are purely extensions with no 'requires'
  • The internals are more organized into modules and moved around, thanks to @BeastyBlacksmith
  • Backend init and backend code is only found in its extensions, this should help with backend interference and annoyances about initialization and precompilation of plots. This should make backends modular and implemented much easier and without hacks into Plots.jl codebase

Example:

using Plots; import UnicodePlots
unicodeplots()
plot(1:10)

What works

  • GR
  • UnicodePlot
  • 90% of tests pass
  • Precompilation

What does not work

Help needed here add more items or resolve the ticks.

  • [x] GR backend has weird axis issue I never got to solve, unicode works consistently same
  • [x] plotly backend
  • [ ] pythonplot backend
  • [x] pgfplotsx backend
  • [x] gaston backend
  • [x] default not resetting legend args

Help needed:

  • [x] Rebase on the master branch
  • [ ] Report breakages
  • [x] Fix GR backend via help of git diff, something must've changed in GR code
  • [ ] move documentation back into this repo
  • [ ] Start updating the docs
  • [ ] Propose other breaking changes
  • [ ] Update the news.md
  • [ ] organize a community poll of what defaults could be tweaked and other wishes

Decisions to be made

  • [ ] Deprecate inspectDR?
  • [ ] Move to column major order?
  • [ ] Change the defaults

Issues needing attention please add more or checkoff resolved: https://github.com/JuliaPlots/Plots.jl/issues/4565#issue-1466819814 Copy of that: Labeled issues:

  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/4532
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/4028
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/3001
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/2980
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/2129
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/2047
  • [x] https://github.com/JuliaPlots/Plots.jl/issues/4181
  • [x] https://github.com/JuliaPlots/Plots.jl/issues/4513
  • [x] https://github.com/JuliaPlots/Plots.jl/issues/4631
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/4350
  • [x] https://github.com/JuliaPlots/Plots.jl/issues/4567
  • [ ] https://github.com/JuliaPlots/Plots.jl/issues/4596

Labeled PRs:

  • [x] https://github.com/JuliaPlots/Plots.jl/pull/4326
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3942
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3744
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3732
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3473
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3357
  • [ ] https://github.com/JuliaPlots/Plots.jl/pull/3351
  • [ ] Rework adding legends #3732

Closes #4326

isentropic avatar Jan 12 '24 04:01 isentropic

@BeastyBlacksmith I started the implementation of the PGFPlotsX backend, not sure how to proceed with the initialization stage there where you load up more side libraries. I feel like before the doing any breaking changes and long-awaited PRs we should make the tests pass now and gradually incorporate breaking changes

isentropic avatar Jan 15 '24 05:01 isentropic

~~Sorry for the mess I didn't mean to revert some of your changes, but I can't quite figure out how to recover at the moment...~~ Fixed

how to proceed with the initialization stage there where you load up more side libraries

To which lines are you referring here?

BeastyBlacksmith avatar Jan 15 '24 12:01 BeastyBlacksmith

init function in ext/PlotsPGFPlotsXExt/initialization.jl

isentropic avatar Jan 16 '24 02:01 isentropic

git can be tricky at times...

isentropic avatar Jan 16 '24 02:01 isentropic

GR kinda works now, thanks to @jheinen I could debug the issue, it was again unsuprisignly because of some methods not being overloaded due to new modules

isentropic avatar Jan 16 '24 05:01 isentropic

Good news, most of GR is passing now: some errors in the unitful other testset, but nothing critical

Test Summary:           | Pass  Fail  Error  Total   Time
backends                |   70     3      5     78  43.8s
  UnicodePlots          |    9                   9   1.2s
  GR - reference images |   60     3      3     66  42.5s
  PlotlyJS              |    1            2      3   0.1s
  Examples              |                     None   0.0s

isentropic avatar Jan 16 '24 09:01 isentropic

I'd say we keep it on the v2 branch for a decent while and retarget the v2-PRs to that branch. There is no need to rush this. Once the v2 branch is in a decent state we should make an announcement on discourse. I am aiming for a release towards the end of the year.

BeastyBlacksmith avatar Jan 17 '24 08:01 BeastyBlacksmith

Yeah you are right, given the unpredictability of the development cycle there is no need to be master, but it could be dev. I remember ]add Plots#dev should work right? I was suggesting this so that we remove friction from trying 2.0 faster and potentially reporting early bugs.

isentropic avatar Jan 17 '24 09:01 isentropic

dev is also fine for me

BeastyBlacksmith avatar Jan 17 '24 15:01 BeastyBlacksmith

@BeastyBlacksmith you have any idea why the plots is erroring out only because i added some code in the extension? The extension is not really activated even

isentropic avatar Jan 22 '24 10:01 isentropic

Which error exactly are you referring to?

BeastyBlacksmith avatar Jan 22 '24 11:01 BeastyBlacksmith

These two things that happenned after my last commits https://github.com/JuliaPlots/Plots.jl/actions/runs/7609991770/job/20722386227?pr=4866 https://github.com/JuliaPlots/Plots.jl/actions/runs/7609991770/job/20722387137?pr=4866

I'm trying to get pythonplot to work and suddenly tests started failing withuot me enabling the relevant test lines

isentropic avatar Jan 22 '24 13:01 isentropic

im also not understanding what is the deal with python plot and the recent breakage with 1.03 version of python plot

isentropic avatar Jan 22 '24 13:01 isentropic

These two things that happenned after my last commits JuliaPlots/Plots.jl/actions/runs/7609991770/job/20722386227?pr=4866 JuliaPlots/Plots.jl/actions/runs/7609991770/job/20722387137?pr=4866

I'm trying to get pythonplot to work and suddenly tests started failing withuot me enabling the relevant test lines

That is using Gtk that errors here.

im also not understanding what is the deal with python plot and the recent breakage with 1.03 version of python plot

Isn't that https://github.com/JuliaPy/PythonPlot.jl/pull/26#issuecomment-1556799332 ?

BeastyBlacksmith avatar Jan 23 '24 08:01 BeastyBlacksmith

I think we are at a point where it makes sense to merge this and then iterate on. I'll copy the OP to the new PR.

BeastyBlacksmith avatar Mar 12 '24 14:03 BeastyBlacksmith