Skip to content

Commit dbb8943

Browse files
authored
Merge pull request #101 from WIAS-PDELib/jf/pythonplot
Pythonplot extension
2 parents 743e643 + 2e7fc7e commit dbb8943

File tree

12 files changed

+1041
-1039
lines changed

12 files changed

+1041
-1039
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [1.16.0] - 2025-11-18
4+
- Add PythonPlot to the backends
5+
36
## [1.15.3] - 2025-06-24
47
- Fixed bug with GLMakie based animated plots from the REPL
58
- Added examples for animated plots from the REPL

Project.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GridVisualize"
22
uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
33
authors = ["Juergen Fuhrmann <[email protected]>", "Patrick Jaap <[email protected]>"]
4-
version = "1.15.4"
4+
version = "1.16.0"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
@@ -26,6 +26,7 @@ MeshCat = "283c5d60-a78f-5afe-a0af-af636b173e11"
2626
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2727
PlutoVista = "646e1f28-b900-46d7-9d87-d554eb38a413"
2828
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
29+
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
2930
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
3031
VTKView = "955f2c64-5fd0-11e9-0ad0-3332e913311a"
3132

@@ -35,6 +36,7 @@ GridVisualizeMeshCatExt = "MeshCat"
3536
GridVisualizePlotsExt = "Plots"
3637
GridVisualizePlutoVistaExt = "PlutoVista"
3738
GridVisualizePyPlotExt = "PyPlot"
39+
GridVisualizePythonPlotExt = "PythonPlot"
3840
GridVisualizeVTKViewExt = "VTKView"
3941

4042
[compat]
@@ -58,6 +60,7 @@ Plots = "1"
5860
PlutoVista = "0.8.24,1"
5961
Printf = "1.6"
6062
PyPlot = "2"
63+
PythonPlot = "1"
6164
StaticArrays = "1"
6265
Triangulate = "2, 3"
6366
VTKView = "0.1,0.2"

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GridVisualize
99
Plotting companion module for [ExtendableGrids.jl](https://github.com/WIAS-PDELib/ExtendableGrids.jl)
1010
Provides plotting of grids, scalar piecewise linear functions and vectors (2D only) for various plotting backends
1111
on simplicial grids in one, two or three space dimensions. The main supported backends
12-
are CairoMakie, GLMakie, PyPlot, and PlutoVista. Plots is only partially supported (1D and 2D rectangular grids).
12+
are CairoMakie, GLMakie, PythonPlot, PyPlot, and PlutoVista. Plots is only partially supported (1D and 2D rectangular grids).
1313

1414
## Disclaimer
1515
The code is rather complex and many codepaths are hard to test. Please be prepared to help
@@ -43,7 +43,7 @@ Plot appearance can be tweaked by a number of
4343
[keyword arguments](https://WIAS-PDELib.github.io/GridVisualize.jl/dev/api/#GridVisualize.available_kwargs).
4444

4545
### Plotters
46-
Plotters can be e.g. Plots, PyPlot, GLMakie, CairoMakie PlutoVista - we pass the module exported
46+
Plotters can be e.g. Plots, PythonPlot, PyPlot, GLMakie, CairoMakie PlutoVista - we pass the module exported
4747
by the package. Different plotters can be used at the same time.
4848

4949
### Multiple plots in one plotting window
@@ -69,7 +69,7 @@ end
6969
### Movies
7070
Currently, these can be recorded with GLMakie, CairoMakie and Plots backends both from
7171
the REPL and Pluto notebooks. MP4 files and gifs can be created.
72-
PyPlot possibly will follow.
72+
PyPlot/PythonPlot possibly will follow.
7373

7474
This shows the animated graphic in the REPL (essentially the same as above)
7575
and creates an embedded video in a Pluto notebook:
@@ -131,26 +131,26 @@ and all plotting functions will do nothing.
131131
- 'p': planned (no schedule though)
132132
- 'n': probably not, also in the future
133133

134-
| | PyPlot | Makie | PlutoVista | Plots | VTKView |
135-
|----------------|--------|-------|------------|-------|---------|
136-
| scalarplot, 1D | y | y | y,i | y | y |
137-
| vectorplot, 1D | y | y | y | y | y |
138-
| gridplot, 1D | y | y | y | y | |
139-
| scalarplot, 2D | y | y | y | (y) | y,i |
140-
| vectorplot, 2D | y | y | y | y | |
141-
| streamplot, 2D | y | y | p | n | |
142-
| gridplot, 2D | y | y,i | y | (y) | y,i |
143-
| scalarplot, 3D | y | y,i | y,i | n | y,i |
144-
| gridplot, 3D | y | y,i | y,i | n | y,i |
145-
| vectorplot, 3D | p | p | p | n | |
146-
| streamplot, 3D | | p | p | n | |
147-
| movie | n | y | n | y | |
148-
| triangulateio | y | y | n | n | n |
134+
| | PyPlot/PythonPlot | Makie | PlutoVista | Plots | VTKView |
135+
|----------------|--------------------|-------|------------|-------|---------|
136+
| scalarplot, 1D | y | y | y,i | y | y |
137+
| vectorplot, 1D | y | y | y | y | y |
138+
| gridplot, 1D | y | y | y | y | |
139+
| scalarplot, 2D | y | y | y | (y) | y,i |
140+
| vectorplot, 2D | y | y | y | y | |
141+
| streamplot, 2D | y | y | p | n | |
142+
| gridplot, 2D | y | y,i | y | (y) | y,i |
143+
| scalarplot, 3D | y | y,i | y,i | n | y,i |
144+
| gridplot, 3D | y | y,i | y,i | n | y,i |
145+
| vectorplot, 3D | p | p | p | n | |
146+
| streamplot, 3D | | p | p | n | |
147+
| movie | n | y | n | y | |
148+
| triangulateio | y | y | n | n | n |
149149

150150
## Sample output
151151

152152

153-
### [PyPlot](https://github.com/JuliaPy/PyPlot.jl):
153+
### [PyPlot](https://github.com/JuliaPy/PyPlot.jl), [PythonPlot](https://github.com/stevengj/PyPlot.jl):
154154
![](https://github.com/WIAS-PDELib/GridVisualize.jl/blob/main/docs/src/assets/multiscene_pyplot.png?raw=true)
155155

156156

@@ -175,7 +175,7 @@ gridplot!(vis,grid,clear=true,show=true)
175175
## Notebooks
176176

177177
### Pluto
178-
Plotting in Pluto notebooks for CairoMakie, PyPlot, Plots, GLMakie is working, WGLMakie probably works in combination with JSServe.
178+
Plotting in Pluto notebooks for CairoMakie, PyPlot, PythonPlot, Plots, GLMakie is working, WGLMakie probably works in combination with JSServe.
179179

180180
Plotting in Pluto notebooks can use [PlutoVista.jl](https://github.com/j-fu/PlutoVista.jl)
181181
based on [plotly.js](https://plotly.com/javascript/) (1D) and [vtk.js](https://kitware.github.io/vtk-js/index.html) (2/3D).

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
1414
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
1515
PlutoVista = "646e1f28-b900-46d7-9d87-d554eb38a413"
1616
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
17+
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
1718
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
1819
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1920
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"

docs/make.jl

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,21 @@ GridVisualizeMeshCatExt = Base.get_extension(GridVisualize, :GridVisualizeMeshCa
1515
GridVisualizeVTKViewExt = Base.get_extension(GridVisualize, :GridVisualizeVTKViewExt)
1616

1717

18-
function mkdocs()
18+
function mkdocs(; with_examples = true)
1919
cleanexamples()
2020
example_dir = joinpath(@__DIR__, "..", "examples")
2121
notebook_dir = joinpath(@__DIR__, "..", "examples")
22-
generated_examples = @docscripts(
23-
example_dir, [
24-
"Plotting Examples" => "plotting.jl",
25-
], Plotter = CairoMakie
26-
)
27-
notebook_examples = @docplutonotebooks(notebook_dir, ["plutovista.jl"], iframe = true, iframe_height = "2000px")
22+
notebook_examples = []
23+
generated_examples = []
24+
if with_examples
25+
generated_examples = @docscripts(
26+
example_dir, [
27+
"Plotting Examples" => "plotting.jl",
28+
], Plotter = CairoMakie
29+
)
30+
notebook_examples = @docplutonotebooks(notebook_dir, ["plutovista.jl"], iframe = true, iframe_height = "2000px")
31+
end
32+
2833
makedocs(;
2934
sitename = "GridVisualize.jl",
3035
modules = [
@@ -54,6 +59,10 @@ function mkdocs()
5459

5560
end
5661

57-
mkdocs()
62+
if isinteractive()
63+
mkdocs(; with_examples = false)
64+
else
65+
mkdocs(; with_examples = true)
66+
end
5867

5968
deploydocs(; repo = "github.com/WIAS-PDELib/GridVisualize.jl.git", devbranch = "main")

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ save
1414
default_plotter
1515
default_plotter!
1616
plottertype
17+
PythonPlotType
1718
PyPlotType
1819
MakieType
1920
PlotsType

docs/src/privapi.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Pages = ["dispatch.jl","common.jl","slice_plots.jl"]
1111

1212
```@docs
1313
ispyplot
14+
ispythonplot
1415
isplutovista
1516
isplots
1617
ismakie
@@ -40,10 +41,10 @@ GridVisualizeMakieExt.FlippableLayout.flayoutscene
4041
GridVisualizePlutoVistaExt
4142
```
4243

43-
## PyPlot
44+
## PyPlot/PythonPlot
4445
```@docs
4546
GridVisualizePyPlotExt
46-
GridVisualizePyPlotExt.tridata
47+
GridVisualize.tridata
4748
```
4849
## Plots
4950
```@docs

0 commit comments

Comments
 (0)