How to change maker in scatter plot in Julia -
i change marker style of 2d scatter plot based on value in vector, displaying 3 dimensions on 2 axes. below i'd , error when try it.
x = rand(1:30,100) y = rand(20:30,100) mymarker = [fill("o",50);fill("x",50)] scatter(x,y,marker=mymarker,alpha=0.5) loaderror: pyerror (:pyobject_call) <type 'exceptions.valueerror'> valueerror(u"unrecognized marker style ['o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x']",) file "/home/lara/.julia/v0.4/conda/deps/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 3251, in scatter edgecolors=edgecolors, data=data, **kwargs) file "/home/lara/.julia/v0.4/conda/deps/usr/lib/python2.7/site-packages/matplotlib/__init__.py", line 1812, in inner return func(ax, *args, **kwargs) file "/home/lara/.julia/v0.4/conda/deps/usr/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 3877, in scatter marker_obj = mmarkers.markerstyle(marker) file "/home/lara/.julia/v0.4/conda/deps/usr/lib/python2.7/site-packages/matplotlib/markers.py", line 171, in __init__ self.set_marker(marker) file "/home/lara/.julia/v0.4/conda/deps/usr/lib/python2.7/site-packages/matplotlib/markers.py", line 252, in set_marker ' {0}'.format(marker)) while loading in[91], in expression starting on line 1 in getindex @ /home/lara/.julia/v0.4/pycall/src/pycall.jl:228 in pysequence_query @ /home/lara/.julia/v0.4/pycall/src/conversions.jl:717 [inlined code] /home/lara/.julia/v0.4/pycall/src/conversions.jl:733 in pytype_query @ /home/lara/.julia/v0.4/pycall/src/conversions.jl:762 in convert @ /home/lara/.julia/v0.4/pycall/src/conversions.jl:782 in pycall @ /home/lara/.julia/v0.4/pycall/src/pycall.jl:363 in call @ /home/lara/.julia/v0.4/pycall/src/pycall.jl:372 in close_queued_figs @ /home/lara/.julia/v0.4/pyplot/src/pyplot.jl:401
i have tried following, neither of want close enough, , neither works.
using plots pyplot(size=(400,200), legend=false) # set backend , set session defaults scatter(rand(30),m = colorgradient([:red,:green,:blue]),zcolor = repmat([0,0.5,1],10)) using plots pyplot(size=(400,200), legend=false) # set backend , set session defaults scatter(rand(30), m = colorgradient([:red,:green,:blue]), # colors defined gradient zcolor = repmat([0,0.5,1],10) # sample gradient, cycling through: 0, 0.5, 1 )
can tell me how make marker take in vector?
update have work around don't having this: dividing data separate sets , plotting them on same axes:
pyplot.plot(spacerdataactualspacer[:length],spacerdataactualspacer[:curvature],marker="x",".") pyplot.plot(spacerdatanoactualspacer[:length],spacerdatanoactualspacer[:curvature],marker="o",".")
there's few different things can try (i'm on plots dev, can't work out of box):
scatter(rand(30), group = repmat(1:3,10), marker=:auto) scatter(rand(30), group = repmat(1:3,10), shape=[:+ :o :utri]) scatter(rand(30), group = repmat(1:3,10), shape=[:+ :o :utri], layout=(3,1))
let me know if of want. honest i'm not totally sure know ideal viz like.
Comments
Post a Comment