0

I'm currently working through this tutorial and I'm having trouble getting the png image to display. This is my program.

using DataFrames
using Gadfly

train_df = readtable("winequality-red.csv", separator=';')

_, count = hist(train_df["quality"])
class = sort(unique(train_df["quality"]))
value_counts = DataFrame(count=count, class=class)
#value_counts

p = plot(value_counts, x="class", y="count", Geom.bar(), Guide.title("Class distributions (\"quality\")"))
draw(PNG(14cm, 10cm), p)

the error I get is

LoadError("C:/Users/John/Desktop/helloworld.jl",12,MethodError(PNG,(140.0mm,100.0mm)))

I've tried some of the things mentioned in this discussion, however I haven't made any observable progress.

John
  • 13,197
  • 7
  • 51
  • 101

1 Answers1

0

I was able to solve my problem by installing Cairo.

Pkg.add("Cairo")

and changing this line

draw(PNG(14cm, 10cm), p)

to

draw(PNG("chart.png", 14cm, 10cm), p)

and then opening chart.png with Julia Studio

enter image description here

John
  • 13,197
  • 7
  • 51
  • 101
  • I used draw(PNG("neuroplot.png", 14cm, 10cm), NeuroPlot) for example and I got this ERROR: Cairo must be installed to use the PNG backend. in PNG at C:\Users\ra133513\.julia\v0.3\Compose\src\Compose.jl:124 – lbenitesanchez Sep 27 '14 at 22:36