Skip to content

Commit

Permalink
isnothing for both PGFPlots.jl and plots.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
tawheeler committed Feb 8, 2021
1 parent 3d15603 commit c76f73f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/PGFPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ using Discretizers
using Printf

# Define isnothing
macro define_isnothing_if_needed()
if VERSION < v"1.1"
return :( isnothing(x) = x === nothing )
else
return :()
end
if VERSION < v"1.1"
isnothing(x) = x === nothing
end
@define_isnothing_if_needed

# load dynamic dependencies
function __init__()
Expand Down Expand Up @@ -449,11 +444,6 @@ end
# commas are properly parsed. Otherwise, an entry like $beta(1,2)$ will fail to compile.
plotLegend(o::IO, entry) = nothing
plotLegend(o::IO, entry::AbstractString) = println(o, "\\addlegendentry{{}{$entry}}")
function plotLegend(o::IO, entries::Vector{T}) where {T <: AbstractString}
for entry in entries
plotLegend(o, entry)
end
end

# todo: add error bars style
function plotHelperErrorBars(o::IO, p::Linear)
Expand Down
5 changes: 5 additions & 0 deletions src/plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const RealRange = Tuple{Real,Real}

include("ndgrid.jl")

# Define isnothing
if VERSION < v"1.1"
isnothing(x) = x === nothing
end

abstract type Plot end

mutable struct Linear <: Plot
Expand Down

0 comments on commit c76f73f

Please sign in to comment.