Gaston: debug mplot
This commit is contained in:
parent
9e66eb5737
commit
e16e46db47
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@ -47,7 +47,7 @@ jobs:
|
|||||||
PYTHON: ""
|
PYTHON: ""
|
||||||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
|
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
|
||||||
run: |
|
run: |
|
||||||
# export JULIA_DEBUG=Documenter
|
export JULIA_DEBUG=Documenter
|
||||||
export PLOTDOCS_ANSICOLOR=true
|
export PLOTDOCS_ANSICOLOR=true
|
||||||
export GKSwstype=nul # Plots.jl/issues/3664
|
export GKSwstype=nul # Plots.jl/issues/3664
|
||||||
xvfb-run julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.add(PackageSpec(name="Plots", rev=split(ENV["GITHUB_REF"], "/", limit=3)[3])); Pkg.instantiate()'
|
xvfb-run julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.add(PackageSpec(name="Plots", rev=split(ENV["GITHUB_REF"], "/", limit=3)[3])); Pkg.instantiate()'
|
||||||
|
|||||||
@ -12,7 +12,7 @@ const GNUPLOT_DPI = 72 # Compensate for DPI with increased resolution
|
|||||||
# Create the window/figure for this backend.
|
# Create the window/figure for this backend.
|
||||||
function _create_backend_figure(plt::Plot{GastonBackend})
|
function _create_backend_figure(plt::Plot{GastonBackend})
|
||||||
xsize, ysize = plt.attr[:size]
|
xsize, ysize = plt.attr[:size]
|
||||||
G.set(termopts="""size $xsize,$ysize""")
|
# G.set(termopts="size $xsize,$ysize")
|
||||||
|
|
||||||
state_handle = G.nexthandle() # for now all the figures will be kept
|
state_handle = G.nexthandle() # for now all the figures will be kept
|
||||||
plt.o = G.newfigure(state_handle)
|
plt.o = G.newfigure(state_handle)
|
||||||
@ -89,14 +89,14 @@ function _show(io::IO, mime::MIME{Symbol("image/png")}, plt::Plot{GastonBackend}
|
|||||||
xsize, ysize = plt.attr[:size] .* scaling
|
xsize, ysize = plt.attr[:size] .* scaling
|
||||||
|
|
||||||
# Scale all plot elements to match Plots.jl DPI standard
|
# Scale all plot elements to match Plots.jl DPI standard
|
||||||
termopts = """size $xsize,$ysize fontscale $scaling lw $scaling dl $scaling ps $scaling"""
|
termopts = "size $xsize,$ysize fontscale $scaling lw $scaling dl $scaling ps $scaling"
|
||||||
|
|
||||||
tmpfile = G.tempname()
|
tmpfile = G.tempname()
|
||||||
G.save(
|
G.save(
|
||||||
term="pngcairo",
|
term="pngcairo",
|
||||||
output=tmpfile,
|
output=tmpfile,
|
||||||
handle=plt.o.handle,
|
handle=plt.o.handle,
|
||||||
saveopts=termopts
|
# saveopts=termopts
|
||||||
)
|
)
|
||||||
while !isfile(tmpfile) end # avoid race condition with read in next line
|
while !isfile(tmpfile) end # avoid race condition with read in next line
|
||||||
write(io, read(tmpfile))
|
write(io, read(tmpfile))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user