正确绘制线数据

Plotting line data correctly

提问人:ponipei 提问时间:11/12/2023 更新时间:11/12/2023 访问量:11

问:

我正在将 SBCL Common lisp 与 Vega Lite 一起使用。

    (defun eod-plot-ticker (item &optional (ndat 100) (par 
       'current-price))
     (let* ((code (eod-search-code item))
     (str (eod-history item ndat))
     (xl (map 'vector 'convert-symbol-yearday
      (map 'vector #'first str)))
     (yl (map 'vector #'cdr str))
     (title (concatenate 'string (string item)
             "   " (string par)))
     (ytitle "value"))
     (plot:plot
     (vega:defplot simple-line-plot
    `(:title ,title
     :width 500
    :height 350   
     :data ,(ls-user::make-df '(:xl :yl) (list xl yl))        
     :mark :line
     :encoding (:x (:field :xl
                     :type :quantitative
                     :title "day date")
                     :y (:field :yl
                     :title ,ytitle
                    :type :quantitative
                    :scale (:domain '(50 100)))))))))

结果是空白显示。如果我定期取出 domain 语句,则数据图,但压缩在 50 到 70 y 值之间。我希望通过减少 y 轴间隔来放大数据行为。我做错了什么?

绘图 线 显示

评论


答: 暂无答案