# Plots with string xaxis and y-errorbars gives error

**URL:** <https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228>\
**Category:** Visualization\
**Created:** [April 8, 2020, 12:19pm UTC](https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228 "2020-04-08T12:19:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![transarcus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/transarcus/32/11186_2.png) [@transarcus](https://discourse.julialang.org/u/transarcus)\
**Post date:** [April 8, 2020, 12:19pm UTC](https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228/1 "2020-04-08T12:19:58Z")

</div>

Plotting a bar plot with text as the xaxis gives me an error where it didn’t use to. I’m using Julia 1.4 and plots v1.0.5

plot([“a”,“b”],[10,2],yerr=[1,1],st=:bar) gives the error “Cannot `convert` an object of type String to an object of type Float64” listed at the bottom.  
plot([“a”,“b”],[10,2],st=:bar) gives no error and plots as I would expect.  
If I change to plots V1.0.4 it still doesn’t work but if I go back to v1.0.0 they both work as normal.

Anyone else experience this?

MethodError: Cannot `convert` an object of type String to an object of type Float64  
Closest candidates are:  
convert(::Type{T}, !Matched::T) where T\<:Number at number.jl:6  
convert(::Type{T}, !Matched::Number) where T\<:Number at number.jl:7  
convert(::Type{T}, !Matched::Base.TwicePrecision) where T\<:Number at twiceprecision.jl:250  
…

Stacktrace:  
[1] setindex!(::Array{Float64,1}, ::String, ::Int64) at .\array.jl:782  
[2] copyto!(::Array{Float64,1}, ::Int64, ::Array{String,1}, ::Int64, ::Int64) at .\abstractarray.jl:842  
[3] nanappend!(::Array{Float64,1}, ::Array{String,1}) at .\array.jl:911  
[4] error\_coords(::Array{Float64,1}, ::Array{Float64,1}, ::Array{String,1}) at C:\Users\padmer.julia\packages\Plots\GzWxB\src\recipes.jl:1024  
[5] macro expansion at C:\Users\padmer.julia\packages\Plots\GzWxB\src\recipes.jl:1054 [inlined]  
[6] apply\_recipe(::Plots.Attr, ::Type{Val{:yerror}}, ::Array{String,1}, ::Array{Float64,1}, ::Nothing) at C:\Users\padmer.julia\packages\RecipesBase\FlaiX\src\RecipesBase.jl:281  
[7] \_process\_seriesrecipe(::Plots.Plot{Plots.PyPlotBackend}, ::Plots.Attr) at C:\Users\padmer.julia\packages\Plots\GzWxB\src\pipeline.jl:435  
[8] \_plot!(::Plots.Plot{Plots.PyPlotBackend}, ::Dict{Symbol,Any}, ::Tuple{Array{String,1},Array{Float64,1}}) at C:\Users\padmer.julia\packages\Plots\GzWxB\src\plot.jl:233  
[9] #plot#135(::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:yerr, :st, :ylabel, :xticks),Tuple{Array{Float64,1},Symbol,String,Tuple{Array{Int64,1},Array{String,1}}}}}, ::typeof(plot), ::Array{String,1}, ::Vararg{Any,N} where N) at C:\Users\padmer.julia\packages\Plots\GzWxB\src\plot.jl:57  
[10] (::RecipesBase.var"#kw##plot")(::NamedTuple{(:yerr, :st, :ylabel, :xticks),Tuple{Array{Float64,1},Symbol,String,Tuple{Array{Int64,1},Array{String,1}}}}, ::typeof(plot), ::Array{String,1}, ::Array{Float64,1}) at .\none:0  
[11] top-level scope at In[11]:1

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [April 9, 2020, 12:56pm UTC](https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228/2 "2020-04-09T12:56:39Z")

</div>

Can you open an issue on [https://github.com/JuliaPlots/Plots.jl/issues](https://github.com/JuliaPlots/Plots.jl/issues)?

---

<div class="post-metadata">

**Author:** ![transarcus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/transarcus/32/11186_2.png) [@transarcus](https://discourse.julialang.org/u/transarcus)\
**Post date:** [April 9, 2020, 1:28pm UTC](https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228/3 "2020-04-09T13:28:39Z")

</div>

First github issue, exciting. It can be found here: [Plots with string xaxis and y-errorbars gives error · Issue #2552 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/2552)

---

<div class="post-metadata">

**Author:** ![transarcus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/transarcus/32/11186_2.png) [@transarcus](https://discourse.julialang.org/u/transarcus)\
**Post date:** [April 30, 2020, 11:48am UTC](https://discourse.julialang.org/t/plots-with-string-xaxis-and-y-errorbars-gives-error/37228/4 "2020-04-30T11:48:24Z")

</div>

This has been fixed and it all works nicely in plots v1.2.0: [fix errorbars with string axes by daschw · Pull Request #2622 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/pull/2622)
