This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GLMakie | |
using DelimitedFiles | |
volcano = readdlm(Makie.assetpath("volcano.csv"), ',', Float64) | |
_, _, ct = contourf(volcano; colormap = :lipari, levels = 20) | |
polys = ct.plots[1][1][] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CairoMakie | |
f = Figure() | |
ax = Axis3(f[1, 1]) | |
for i in 1:5 | |
data = abs.(cumsum(randn(50))) .+ 1 | |
b = band!(ax, 1:50, zero(data), data) | |
Makie.transform!(b, (:xz, -i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function detect_png_dpi(io::IO) | |
# PNG header signature | |
png_signature = UInt8['\u89', 'P', 'N', 'G', '\r', '\n', '\u1a', '\n'] | |
# Reset the IO position to the beginning | |
seekstart(io) | |
# Check if the PNG signature is present | |
if [read(io, UInt8) for _ in 1:length(png_signature)] != png_signature | |
error("Not a png file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = Figure() | |
ax = Axis(f[1, 1], xticks = 1:10) | |
textplot = ax.xaxis.elements[:ticklabels].plots[1].plots[1] | |
glyphcollections = textplot[1] | |
bracket!(ax.blockscene, lift(textplot.position, glyphcollections, textplot.rotation) do positions, gcs, rot | |
bboxes = map(positions, gcs) do pos, gc | |
Makie.boundingbox(gc, pos, Makie.to_rotation(rot)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f, _ = lines(0..8, sin, color = :blue, linewidth = 10) | |
lines!(0..8, cos, color = :red, alpha = 0.5, linewidth = 10) | |
f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CairoMakie | |
using Cairo | |
using Poppler_jll | |
@recipe(PDF) do scene | |
Attributes( | |
bbox = BBox(0, 100, 0, 100) | |
) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Item | Galleons | Sickles | Knuts | snippet_id | |
---|---|---|---|---|---|
Triwizard Cup | 1000 | 0 | 0 | 28 | |
Prize Money | 1000 | 0 | 0 | 29 | |
Split the thousand Galleons | 1000 | 0 | 0 | 32 | |
Prize Money | 1000 | 0 | 0 | 33 | |
Goblet of Fire entry fee | 1000 | 0 | 0 | 34 | |
Winnings | 1000 | 0 | 0 | 38 | |
Canary Creams | 1000 | 0 | 0 | 40 | |
Triwizard Tournament Prize Money | 1000 | 0 | 0 | 44 | |
Wanted Poster | 1000 | 0 | 0 | 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"snippet_range":[93084,93723],"snippet":"\n“He wants payin’ fer deliverin’ the paper. Look in the \npockets.” \nHagrid ’s coat seemed to be made of nothing but \npockets — bunches of keys, slug pellets, balls of \nstring, peppermint humbugs, teabags ... finally, Harry \npulled out a handful of strange-looking coins. \n“Give him five Knuts,” said Hagrid sleepily. \n“Knuts?” \n“The little bronze ones.” \nHarry counted out five little bronze coins, and the owl \nheld out his leg so Harry could put the money into a \n\nsmall leather pouch tied to it. Then he flew off \nthrough the open window. \nHagrid yawned loudly, sat up, and stretched. \n“Best be off, Harry, lots t","response":"Item,Galleons,Sickles,Knuts\n\"Owl Delivery\",0,0,5"},{"snippet_range":[106718,107323],"snippet":"ht more eyes. He \nturned his head in every direction as they walked up \nthe street, trying to look at everything at once: the \nshops, the things outside them, the people doing their \nshopping. A plump woman outside an Apothecary \nwa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = Scene(camera = campixel!) | |
nodes = Point2f[(100, 100), (200, 300), (100, 400), (500, 400)] | |
for i in 1:length(nodes)-1 | |
for j in i+1:length(nodes) | |
linesegments!(s, nodes[[i, j]]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = Figure() | |
ax = Axis(f[1, 1]) | |
sc = scatter!(randn(10, 2), label = "Points") | |
text!(randn(10, 2), text = ["hey" for _ in 1:10], color = :red) | |
leg = Legend(f[1, 2], [sc, []], ["Points", "Location of heys"]) | |
legscene = leg.blockscene.children[1] | |
leg.grid[1, 1][2, 1] = Label(legscene, "hey", color = :red) | |
notify(leg.margin) # adjust to new legend size without relayout | |
f |