Hi all,
I try to plot sin(1/x) by using Makie(CairoMakie)
https://makie.juliaplots.org/stable/tutorials/basic-tutorial/
using CairoMakie
x = LinRange(0, 10, 100)
y = sin.(1/x)
fig = Figure()
lines(fig[1, 1], x, y, color = :red)
lines(fig[1, 2], x, y, color = :blue)
lines(fig[2, 1:2], x, y, color = :green)
fig
There are errors when I do the code above ( I don’t really understand how to convert the arguments), is it impossible to plot sin(1/x) for Makie?
Makie.convert_arguments
for the plot type Lines{Tuple{LinRange{Float64, Int64}, LinearAlgebra.Transpose{Float64, Vector{Float64}}}} and its conversion trait PointBased() was unsuccessful.
The signature that could not be converted was:
::Vector{Float32}, ::Matrix{Float32}
Makie needs to convert all plot input arguments to types that can be consumed by the backends (typically Arrays with Float32 elements).
You can define a method for Makie.convert_arguments
(a type recipe) for these types or their supertypes to make this set of arguments convertible (See http://makie.juliaplots.org/stable/recipes.html).
Alternatively, you can define Makie.convert_single_argument
for single arguments which have types that are unknown to Makie but which can be converted to known types and fed back to the conversion pipeline.