I used the PyPlot library in Julia to plot, and the scatter function seems to be a "bit" inconvenience, namely, that takes only coordinates as two arguments: one array for all x values, and the other for all y values, i.e.
scatter(xxs,yys)
with x=[x1,x2,...] and y=[y1,y2,...] .
If I have a set or tuple with coordinate points, for example,
A=([x1,y1],[x2,y2],...)
using pyplot / matplotlib directly in Python, solves the inconvenience in a single liner, like atested https : //stackoverflow.com/a/3/7/12/16/16/16/16/16/16/16/...
plt.scatter(*zip(*li))
but it seems that the zip on Julia works in a completely different way. So far I have come up with the following solution, but it seems rather inelegant:
x=[] y=[] for j in selectos append!(x,j[2]) append!(y,j[1]) end scatter(x,y, marker="o",c="black")
Is there a more “functional” or single-line (or two liners) approach?
wpkzz source share