ruby-numo / numo-gnuplot

Gnuplot wrapper for Ruby/Numo
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

not work on mac m1 gnuplot #24

Closed daddygongon closed 1 year ago

daddygongon commented 3 years ago

Thanks for maintaining great gem.👍 Unfortunately on my new mac m1(BigSur), numo-gnuplot doesn' t work. The error tells,

Traceback (most recent call last):
    3: from test.rb:5:in `<main>'
    2: from /Users/bob/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/numo-gnuplot-0.2.4/lib/numo/gnuplot.rb:79:in `plot'
    1: from /Users/bob/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/numo-gnuplot-0.2.4/lib/numo/gnuplot.rb:94:in `_plot_splot'
/Users/bob/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/numo-gnuplot-0.2.4/lib/numo/gnuplot.rb:307:in `run':  (Numo::GnuplotError)
qt.qpa.fonts: Populating font family aliases took 408 ms. Replace uses of missing font family "Monospace 12" with one that exists to avoid this cost.

The code is

require "numo/gnuplot"

gp = Numo::Gnuplot.new
gp.set title:"Example Plot"
gp.plot "sin(x)",w:"lines"

and the gnuplot is


    G N U P L O T
    Version 5.4 patchlevel 1    last modified 2020-12-01 

    Copyright (C) 1986-1993, 1998, 2004, 2007-2020
    Thomas Williams, Colin Kelley and many others

    gnuplot home:     http://www.gnuplot.info
    faq, bugs, etc:   type "help FAQ"
    immediate help:   type "help"  (plot window: hit 'h')

Terminal type is now 'qt'

I've search around the error related issues, but can't fix them.

mephistobooks commented 1 year ago

create a file ~/.gnuplot and write for example:

set term qt font "Arial"

(Here, "Arial" must be existed in your Mac.)

we can check fonts Font Book.app.

daddygongon commented 1 year ago

Thanks. I've set it as 'monospace', ... Although I've been using 'rbplotly' for a while, I will be back soon to numo/gnuplot.