Powerful convenience for Julia visualizations and data analysis http://juliaplots.github.io/
github-actions[bot] on v0.14.21
BeastyBlacksmith on master
0.14.21 (compare)
BeastyBlacksmith on new_version
BeastyBlacksmith on new_version
CompatHelper: bump compat for "… (compare)
BeastyBlacksmith on new_version
BeastyBlacksmith on master
CompatHelper: bump compat for "… (compare)
BeastyBlacksmith on input
Update input_data.md closes ht… (compare)
BeastyBlacksmith on master
Update README.md [skip ci] (compare)
SimonDanisch on new_version
SimonDanisch on master
CompatHelper: bump compat for "… Merge pull request #427 from Ju… (compare)
## Plots with several of colors
using DelimitedFiles
using Plots
default(fmt = :png)
pointcloud = readdlm("data/question_image.csv",',');
# The x and y coordinates for the first 2 rows of the data an can be extracted from the array separately
point_data = pointcloud[1:2,:];
# The intensity data of the pointcloud forms the last row, and can be saved separately
color_data = pointcloud[3,:];
# Plot the 2D point cloud data with intensity values!
start = time()
plot(point_data[1,:], point_data[2,:], seriestype = :scatter, markersize = 0.1,
markerstrokewidth = 0, dpi = 150, markercolor = cgrad(:rainbow, rev = true),
marker_z = color_data, legend = false)
display(plot!())
elapsed = time() - start
display(elapsed)
using DelimitedFiles
using Plots
default(fmt = :png)
start = time()
# Your code starts here
points = readdlm("data/question_image.csv",',');
scatter(points[1,:],points[2,:],markersize = 0.1,legend = false)
display(plot!())
elapsed = time()-start
display(elapsed)
display(size(points))
color
as a kwarg is passed to font
RBGA
(colorant) type
coloralpha(colorant"grey", 0.34)
plot
and the lines will look right.
freq => intensity
and you want to plot intensity like bars with x
at freq
?
value => frequency
1 => 17
if the number 1 occurs 17 times
[slack] <dpsanders> You can do
ks = collect(keys(frequencies))
vs = collect(values(frequencies))
p = sortperm(ks)
plot(ks[p], vs[p], m=:o)
end
but that is… pretty complicated
bar!
maybe
Dict
was a histogram, you can plot that directly 😉
plot
can handle Dict
directly
plot
😉
Dict
s
plot(.... st=:scatter)
countmap
should return a special CountMap
type
[slack] <jling> ```julia> a = SortedDict(x=>rand() for x = 1:10)
SortedDict{Any,Any,Base.Order.ForwardOrdering} with 10 entries:
1 => 0.305353
2 => 0.042019
3 => 0.507064
4 => 0.677382
5 => 0.523015
6 => 0.0424785
7 => 0.942855
8 => 0.519996
9 => 0.487269
10 => 0.328405
julia> plot(a)```
SortedDict
from DataStructures.jl
ks = sort!(collect(keys(frequencies)))
plot(ks, [frequencies[k] for k in ks])
Dict
) but failed, where are the recipe now?
@which
?
hspan!() has an odd behaviour in Plots v1.6.6, instead of plotting from -Inf to +Inf over x it plots from 1 to 2. Minimum example
julia> plot(0:9)
julia> hspan!([2,3])
I am surprised to see this definition, that seems plain wrong
@recipe function f(::Type{Val{:hspan}}, x, y, z)
n = div(length(y), 2)
newx = repeat([1, 2, 2, 1, NaN], outer = n)
newy = vcat([[y[2i - 1], y[2i - 1], y[2i], y[2i], NaN] for i = 1:n]...)
linewidth --> 0
x := newx
y := newy
seriestype := :shape
()
end
I think that using Inf similarly to vspan would fix this issue
@recipe function f(::Type{Val{:vspan}}, x, y, z)
n = div(length(y), 2)
newx = vcat([[y[2i - 1], y[2i - 1], y[2i], y[2i], NaN] for i = 1:n]...)
newy = repeat([-Inf, Inf, Inf, -Inf, NaN], outer = n)
linewidth --> 0
x := newx
y := newy
seriestype := :shape
()
end