Skip to content

Commit

Permalink
Create docs on pushing to master (JuliaPlots#3494)
Browse files Browse the repository at this point in the history
* Create docs.yml

* Update docs.yml

* Update docs.yml

* Create docs.yml

* Update docs.yml

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* Update docs.yml

* Update docs.yml

* Update docs.yml

* Update docs.yml

* fix pgfplotsx

* fix pyplot

* remove push workflow (should work without)

* conditionally fix pyplot

* change env-vars

* fix

* fix ref

* clean up and cache artifacts

* add Documenter_key to environment

* fix parentheses

* "one last fix"

* dev => add

* fix marker example

* exclude 50 for plotly

* install ms fonts

* only trigger on master

* remove REF pretending
  • Loading branch information
BeastyBlacksmith authored and daschw committed Jun 13, 2021
1 parent b2c330b commit 7195e15
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 8 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: docs

on:
push:
branches:
- master
tags: '*'

jobs:
Build_docs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
repository: JuliaPlots/PlotDocs.jl
- uses: julia-actions/setup-julia@v1
- name: Cache artifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y qt5-default \
ttf-mscorefonts-installer \
poppler-utils \
pdf2svg \
texlive-latex-base \
texlive-binaries \
texlive-pictures \
texlive-latex-extra \
texlive-luatex \
ghostscript-x \
libgconf2-4
sudo fc-cache -vr
- name: build documentation
env:
PYTHON: ""
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: |
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 'withenv("GITHUB_REPOSITORY" => "JuliaPlots/PlotDocs.jl") do; include("docs/make.jl"); end'
5 changes: 3 additions & 2 deletions src/backends/pgfplotsx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function surface_to_vecs(x::AVec, y::AVec, s::Union{AMat,Surface})
end
return xn, yn, zn
end
surface_to_vecs(x::AVec, y::AVec, z::AVec) = x, y, z

function Base.push!(pgfx_plot::PGFPlotsXPlot, item)
push!(pgfx_plot.the_plot, item)
Expand Down Expand Up @@ -483,8 +484,8 @@ function pgfx_add_series!(::Val{:surface}, axis, series_opt, series, series_func
push!(
series_opt,
"surf" => nothing,
"mesh/rows" => length(opt[:x]),
"mesh/cols" => length(opt[:y]),
"mesh/rows" => length(unique(opt[:x])), # unique if its all vectors
"mesh/cols" => length(unique(opt[:y])),
"z buffer" => "sort",
"opacity" => alpha === nothing ? 1.0 : alpha,
)
Expand Down
10 changes: 8 additions & 2 deletions src/backends/pyplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,14 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
ax.spines["left"]."set_position"("zero")
end
elseif sp[:framestyle] in (:grid, :none, :zerolines)
for (loc, spine) in ax.spines
spine."set_visible"(false)
if PyPlot.version >= v"3.4.1" # that is one where it worked, the API change may have some other value
for spine in ax.spines
ax.spines[string(spine)]."set_visible"(false)
end
else
for (loc, spine) in ax.spines
spine."set_visible"(false)
end
end
if sp[:framestyle] == :zerolines
ax."axhline"(y = 0, color = py_color(sp[:xaxis][:foreground_color_axis]), lw = py_thickness_scale(plt, 0.75))
Expand Down
9 changes: 5 additions & 4 deletions src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mutable struct PlotExample
exprs::Vector{Expr}
end

# the _examples we'll run for each
# the _examples we'll run for each backend
const _examples = PlotExample[
PlotExample( # 1
"Lines",
Expand Down Expand Up @@ -241,14 +241,15 @@ const _examples = PlotExample[
m -> m in Plots.supported_markers(),
Plots._shape_keys,
)
markers = reshape(markers, 1, length(markers))
markers = permutedims(markers)
n = length(markers)
x = range(0, stop = 10, length = n + 2)[2:(end - 1)]
y = repeat(reshape(reverse(x), 1, :), n, 1)
scatter(
x,
y,
m = (8, :auto),
m = markers,
markersize = 8,
lab = map(string, markers),
bg = :linen,
xlim = (0, 10),
Expand Down Expand Up @@ -1170,7 +1171,7 @@ _backend_skips = Dict(
:gr => [25, 30, 47],
:pyplot => [2, 25, 30, 31, 47, 49],
:plotlyjs => [2, 21, 24, 25, 30, 31, 49, 51],
:plotly => [2, 21, 24, 25, 30, 31, 49, 51],
:plotly => [2, 21, 24, 25, 30, 31, 49, 50, 51],
:pgfplotsx => [
2, # animation
6, # images
Expand Down

0 comments on commit 7195e15

Please sign in to comment.