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

Feature request: Parallel Coordinates Plot #218

Closed
ngphuoc opened this issue Sep 6, 2018 · 5 comments
Closed

Feature request: Parallel Coordinates Plot #218

ngphuoc opened this issue Sep 6, 2018 · 5 comments

Comments

@ngphuoc
Copy link

ngphuoc commented Sep 6, 2018

Could you please add graph_objs.Parcoords as in plotly.graph_objs.Parcoords in python https://plot.ly/python/parallel-coordinates-plot/? It is a very useful plot for high dimensional data.

@sglyon
Copy link
Member

sglyon commented Sep 6, 2018

Ahh yes, sorry. I believe I did not keep the trace list up to date. Will do

@sglyon
Copy link
Member

sglyon commented Sep 6, 2018

Actually, I just checked and I think this is already available with the function parcoords

Can you please verify?

@ngphuoc
Copy link
Author

ngphuoc commented Sep 6, 2018

That would be great. I tried a plot similar to the python one. I get an error below, could you help me correct it?

parcoords(;line = attr(color = "blue"),
        dimensions = [
            attr(range = [1,5],
                 constraintrange = [1,2],
                 label = "A", values = [1,4]),
            attr(range = [1.5,5],
                 tickvals = [1.5,3,4.5],
                 label = "B", values = [3,1.5]),
            attr(range = [1,5],
                 tickvals = [1,2,4,5],
                 label = "C", values = [2,4],
                 ticktext = ["text 1", "text 2", "text 3", "text 4"]),
            attr(range = [1,5],
                 label = "D", values = [4,2])
        ]) 
#  parcoords with fields dimensions, line, and type
plot(parcoords)
MethodError: no method matching Plot(::typeof(parcoords))
Closest candidates are:
  Plot(::Function, !Matched::Number, !Matched::Number) at /home/ngphuoc/.julia/packages/PlotlyBase/JySFo/src/convenience_api.jl:72
  Plot(::Function, !Matched::Number, !Matched::Number, !Matched::Layout; style, kwargs...) at /home/ngphuoc/.julia/packages/PlotlyBase/JySFo/src/convenience_api.jl:72
  Plot(; style) at /home/ngphuoc/.julia/packages/PlotlyBase/JySFo/src/PlotlyBase.jl:52
  ...

Stacktrace:
 [1] #plot#4(::Dict{Any,Any}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function) at /home/ngphuoc/.julia/dev/PlotlyJS/src/display.jl:198
 [2] plot(::Function) at /home/ngphuoc/.julia/dev/PlotlyJS/src/display.jl:198
 [3] top-level scope at In[16]:1

@sglyon
Copy link
Member

sglyon commented Sep 6, 2018

Ahh I think you are not storing your parcoords trace.

Try something like trace = parcoords(YOUR_CODE_HERE)

And then plot(trace)

@ngphuoc
Copy link
Author

ngphuoc commented Sep 6, 2018

Silly me, it works! Many thanks.

@ngphuoc ngphuoc closed this as completed Sep 6, 2018
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

2 participants