JupyterLab Plotting Problem

Hi all,

I have been trying to plot and compare the result in:

  1. JupyterLab / iJulia
  2. Julia REPL

I try this code:

using Plots, LaTeXStrings, Plots.PlotMeasures
gr()

f(x) = x^(2)
g(x) = x^(4)
h(x) = x^(6)

plot(f,-10,10, xticks=false, xlims=(-10,10), ylims=(-10,10), 
    bottom_margin = 10mm, label=L"f(x) = x^{2}", framestyle = :zerolines, 
    legend=:outerright)
plot!(g,-10,10, xticks=false, xlims=(-10,10), ylims=(-10,10), 
    bottom_margin = 10mm, label=L"f(x) = x^{4}", framestyle = :zerolines, 
    legend=:outerright)
plot!(h,-10,10, xticks=false, xlims=(-10,10), ylims=(-10,10), 
    bottom_margin = 10mm, label=L"f(x) = x^{6}", framestyle = :zerolines, 
    legend=:outerright)

# horizontal green dash line
plot!([2,0],[f(2),f(2)], label="", linecolor=:green, linestyle=:dash)

# vertical green dash line
plot!([2,2],[0,f(2)], label="", linecolor=:green, linestyle=:dash)

annotate!([(-0.5,f(5), (L"x^{\alpha}", 10, :black))])
annotate!([(2,-0.5, (L"x", 10, :black))])
annotate!([(8,5.55, (L"dom(f)=\mathbb{R}", 10, :black))])
annotate!([(8,4.55, (L"codom(f)=\mathbb{R_{+}}", 10, :black))])

In JupyterLab, the x^{6} graph is cutted, but when I use Julia REPL it shows fully. Why is it happening?

Julia REPL result:

This happens in JupyterLab, when I try Its All Set tutorial, sometimes the plot has missing edges, points, or something.

1 Like

sampling?

Try
plot!(h,-5,5,

1 Like

It works!

How can plot!(h,-5,5,.. works?

Is the smaller the better / showing the whole plot?