Plot from Julia embedded in C/C++ app

embedding

#1

Hi all,

is it possible to plot from an embedded Julia from a C/C++ application? I am trying the following example, but no plot window appears. Also tried with gr() and plotlyjs() backends, no success so far…

int main()
{
    jl_init();
    
     jl_eval_string("using Plots; x=1:10; y=randn(10,2); plotly(); plot(x,y);");
     if (jl_exception_occurred())
            jl_printf(jl_stdout_stream(), "%s \n", jl_typeof_str(jl_exception_occurred()));
    
    int ret = 0;
    jl_atexit_hook(ret);
    return ret;
}

#2

you need a display(plot(x,y))


#3

Thanks, that was the missing link! :smiley: