{"action":"created","issue":{"url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/379","repository_url":"https://api.github.com/repos/tbreloff/Plots.jl","labels_url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/379/comments","events_url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/379/events","html_url":"https://github.com/tbreloff/Plots.jl/issues/379","id":164157178,"number":379,"title":"Conversion Issue","user":{"login":"ChrisRackauckas","id":1814174,"avatar_url":"https://avatars.githubusercontent.com/u/1814174?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisRackauckas","html_url":"https://github.com/ChrisRackauckas","followers_url":"https://api.github.com/users/ChrisRackauckas/followers","following_url":"https://api.github.com/users/ChrisRackauckas/following{/other_user}","gists_url":"https://api.github.com/users/ChrisRackauckas/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisRackauckas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisRackauckas/subscriptions","organizations_url":"https://api.github.com/users/ChrisRackauckas/orgs","repos_url":"https://api.github.com/users/ChrisRackauckas/repos","events_url":"https://api.github.com/users/ChrisRackauckas/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisRackauckas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-06T19:40:41Z","updated_at":"2016-07-06T21:13:53Z","closed_at":null,"body":"Plots.jl is having issues with converting arbitrary type Any arrays of Matrices (which should be vectors) into something plottable. This wasn't an issue in previous versions (~2 weeks ago?), but this code throws an error on the latest release and on dev:\r\n\r\n```julia\r\nusing Plots\r\n\r\nx = Rational{Int64}[1//2048,1//1024,1//512,1//256,1//128,1//64,1//32,1//16]\r\ny = Dict(\"path1\"=>rand(100,8),\"path2\"=>rand(100,8),\"path3\"=>rand(100,8))\r\n\r\ntype testType\r\n x\r\n y\r\nend\r\n\r\n@recipe function f(tt::testType)\r\n vals = [mean(y,1) for y in values(tt.y)]'\r\n seriestype --> :path\r\n xguide  --> \"Convergence Axis\"\r\n label  --> [key for key in keys(tt.y)]'\r\n yguide  --> \"Error\"\r\n xscale --> :log10\r\n yscale --> :log10\r\n println(vals)\r\n println(typeof(vals))\r\n println(tt.x)\r\n println(typeof(tt.x))\r\n println(map(typeof,vals))\r\n tt.x, vals\r\nend\r\n\r\ntt = testType(x,y)\r\nplot(tt)\r\ngui()\r\n```\r\n\r\nIt prints out\r\n\r\n```\r\nAny[\r\n[0.5007541654959673\r\n 0.47212986961233705\r\n 0.48839082021222363\r\n 0.49871896937140475\r\n 0.4970484319637364\r\n 0.5148843364895784\r\n 0.5001334949226919\r\n 0.455567232041333] [0.5202282809140185\r\n 0.5165789857837251\r\n 0.47585822983320136\r\n 0.501648864059354\r\n 0.4781814164552657\r\n 0.4996520831000397\r\n 0.4403669446503416\r\n 0.4815016237393302] [0.5288202843802993\r\n 0.5126985157649259\r\n 0.49759862659630144\r\n 0.47372249105393516\r\n 0.48703238578020874\r\n 0.4584599184289848\r\n 0.4983141145467932\r\n 0.46964655137791755]]\r\nArray{Any,2}\r\nRational{Int64}[1//2048,1//1024,1//512,1//256,1//128,1//64,1//32,1//16]\r\nArray{Rational{Int64},1}\r\n[Array{Float64,2} Array{Float64,2} Array{Float64,2}]\r\n```\r\n\r\nwith the error message snipped from Juno:\r\n\r\n![error](https://cloud.githubusercontent.com/assets/1814174/16631993/d7e7bee4-4376-11e6-831d-a3c46b0004de.PNG)\r\n\r\nWhat's rather peculiar is that if you just take the output and plot it:\r\n\r\n```\r\ny= Any[\r\n[0.5007541654959673\r\n 0.47212986961233705\r\n 0.48839082021222363\r\n 0.49871896937140475\r\n 0.4970484319637364\r\n 0.5148843364895784\r\n 0.5001334949226919\r\n 0.455567232041333] [0.5202282809140185\r\n 0.5165789857837251\r\n 0.47585822983320136\r\n 0.501648864059354\r\n 0.4781814164552657\r\n 0.4996520831000397\r\n 0.4403669446503416\r\n 0.4815016237393302] [0.5288202843802993\r\n 0.5126985157649259\r\n 0.49759862659630144\r\n 0.47372249105393516\r\n 0.48703238578020874\r\n 0.4584599184289848\r\n 0.4983141145467932\r\n 0.46964655137791755]]\r\nx = Rational{Int64}[1//2048,1//1024,1//512,1//256,1//128,1//64,1//32,1//16]\r\nplot(x,y)\r\n```\r\n\r\nit works. In v0.5 it should automatically work because the issue is due to mean not dropping the extra dimension.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/comments/230908795","html_url":"https://github.com/tbreloff/Plots.jl/issues/379#issuecomment-230908795","issue_url":"https://api.github.com/repos/tbreloff/Plots.jl/issues/379","id":230908795,"user":{"login":"tbreloff","id":933338,"avatar_url":"https://avatars.githubusercontent.com/u/933338?v=3","gravatar_id":"","url":"https://api.github.com/users/tbreloff","html_url":"https://github.com/tbreloff","followers_url":"https://api.github.com/users/tbreloff/followers","following_url":"https://api.github.com/users/tbreloff/following{/other_user}","gists_url":"https://api.github.com/users/tbreloff/gists{/gist_id}","starred_url":"https://api.github.com/users/tbreloff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbreloff/subscriptions","organizations_url":"https://api.github.com/users/tbreloff/orgs","repos_url":"https://api.github.com/users/tbreloff/repos","events_url":"https://api.github.com/users/tbreloff/events{/privacy}","received_events_url":"https://api.github.com/users/tbreloff/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T21:13:53Z","updated_at":"2016-07-06T21:13:53Z","body":"This works if you change to:\r\n\r\n```\r\nvals = Any[mean(y,1)' for y in values(tt.y)]\r\n```\r\n\r\nSo you understand the difference, previously you had a \"vector of row-vectors\" (i.e. 1xn matrices), and you transposed the outside matrix, which made a \"row-vector of column-vectors\".  Matrices of matrices which are also poorly typed aren't handled well, however if it was a Vector{Any} instead of a Matrix{Any} then it works.  (I have special logic for Vector{Any}).   My change creates a \"vector of column-vectors\", which works, even with badly typed objects."}}
{"actor":{"display_login":"tbreloff"}}