CrypticParadigm
CrypticParadigm

Reputation: 227

Julia plots consistently not working

I have been trying to plot using the "Plots" package in Julia and it never seems to plot anything. Specifically, I am using a Jupyter notebook with a Julia kernel, and every time I try to plot something the output is blank. This is really frustrating especially when I try using the code (below) provided in the Plots tutorial and it doesn't even work. I installed and updated the Plots package and nothing comes out. No errors or anything just a blank cell.

using Plots
x = 1:10 ; y = rand(10) # These are the plotting data
plot(x,y)

Why isn't this working?

Upvotes: 1

Views: 2283

Answers (1)

arjun
arjun

Reputation: 1203

using Plots
x = 1:10 ; y = rand(10) # These are the plotting data
gr()
plot(x,y)

It is good practice to mention the backend plotting engine, in this case, GR.

Also, when you are working with Julia, the packages are dynamically loaded. So, when you are using a package, it may take some significant amount of time.

Also, a tip. When you see a star before the cell in Jupyter, like In[*], please understand that the cell is still being executed.

Reference: Julia Tutorial - Julia Plots

Upvotes: 1

Related Questions