Skip to content

Commit

Permalink
add PGFPlotsX imports
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Jan 16, 2024
1 parent fba82c9 commit 59b436d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
7 changes: 6 additions & 1 deletion ext/PlotsPGFPlotsXExt/PlotsPGFPlotsXExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module PlotsPGFPlotsExt
module PlotsPGFPlotsXExt

using PGFPlotsX
using LaTeXStrings: LaTeXString
using UUIDs: uuid4
using Latexify: Latexify
using Contour: Contour # TODO: this could become its own extension

using Plots: Plots, isijulia, texmath2unicode, straightline_data, shape_data
# TODO: eliminate this list
using Plots:
Expand Down
10 changes: 1 addition & 9 deletions ext/PlotsPGFPlotsXExt/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ end
Plots.backend_name(::T) = sym
Plots.backend_package_name(::T) = Plots.backend_package_name(sym)

# Maybe this is not needed as PGFPlotsX relies on pkgextensions too
# _pre_imports(::T) = @eval Plots begin
# import LaTeXStrings: LaTeXString
# import UUIDs: uuid4
# import Latexify
# import Contour
# @require_backend PGFPlotsX
# end

Check warning on line 29 in ext/PlotsPGFPlotsXExt/initialization.jl

View workflow job for this annotation

GitHub Actions / check

[JuliaFormatter] reported by reviewdog 🐶 Raw Output: ext/PlotsPGFPlotsXExt/initialization.jl:29:-
const _pgfplotsx_attr = merge_with_base_supported([
:annotations,
Expand Down Expand Up @@ -226,4 +218,4 @@ end
# Plots.supported_attrs(::GRbackend) -> ::Vector{Symbol}
# ...
# Plots.supported_scales(::GRbackend) -> ::Vector{Symbol}
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
8 changes: 7 additions & 1 deletion src/abstract_backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ function unicodeplots(; kw...)
end
export unicodeplots

function pgfplotsx(; kw...)
default(; reset = false, kw...)
backend(:pgfplotsx)
end
export pgfplotsx

# Consider moving to a macro:
# $sym(; kw...) = (default(; reset = false, kw...); backend($T()))

Expand Down Expand Up @@ -231,4 +237,4 @@ function warn_on_unsupported_scales(pkg::AbstractBackend, plotattributes::AKW)
end
end
end
end
end

0 comments on commit 59b436d

Please sign in to comment.