Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Plot directly to file

$
0
0

@HenrikM wrote:

I am preparing my Julia code as scripts that will run on a remote compute server. When I run the example locally, as julia --project test1.jl, it produces a file sine.pdf. When I run it remotely, it gives the following error:

QXcbConnection: Could not connect to display
Aborted
connect: Connection refused
GKS: can’t connect to GKS socket application
Did you start ‘gksqt’?

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS

It does, however, also produce the figure sine.pdf.
What should I do to get rid of the error message?

using Plots

x = range(0, 2π, length=300)
y = sin.(x)

fig = plot(x, y);
savefig(fig, "sine.pdf")

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles