Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legendentry parameter to Histogram plots #177

Closed
lkruse opened this issue Aug 17, 2021 · 0 comments
Closed

Add legendentry parameter to Histogram plots #177

lkruse opened this issue Aug 17, 2021 · 0 comments

Comments

@lkruse
Copy link

lkruse commented Aug 17, 2021

Legend entries can be entered via the legendentry command for Linear plots, as in the following example:

x = [1,2,3]
y = [2,4,1]
pushPGFPlotsOptions("scale=1.5")
a = Axis(Plots.Linear(x, y, legendentry="My Plot"), 
        xlabel="X", ylabel="Y", title="My Title")

legend_example

However, attempting to add a legendentry for a Histogram produces the following error:

d = randn(100)        
b = Axis(Plots.Histogram(d, bins=10, legendentry="My Plot"), ymin=0)
ERROR: LoadError: MethodError: no method matching PGFPlots.Plots.Histogram(::Vector{Float64}; bins=10, legendentry="My Plot")
Closest candidates are:
  PGFPlots.Plots.Histogram(::Any; bins, discretization, density, cumulative, style, texlabel) at /home/liam/.julia/packages/PGFPlots/HMdMV/src/plots.jl:83 got unsupported keyword argument "legendentry"
Stacktrace:
 [1] kwerr(::NamedTuple{(:bins, :legendentry), Tuple{Int64, String}}, ::Type, ::Vector{Float64})
   @ Base ./error.jl:157
 [2] top-level scope
   @ ~/T-ITS2021StochasticIDM/plots.jl:190
in expression starting at /home/liam/T-ITS2021StochasticIDM/plots.jl:190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant