From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id GDFlBkqGUGZrhQEAe85BDQ:P1 (envelope-from ) for ; Fri, 24 May 2024 14:21:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id GDFlBkqGUGZrhQEAe85BDQ (envelope-from ) for ; Fri, 24 May 2024 14:21:30 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WJTDFc7u; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716553290; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=CnQjtLq8X6UUExqtrDHrQhqJXCYaborZFQ7NQrT+69A=; b=VCIrb2MU0RcCZkk3LeqSFD7YpauQQDmPce3p4QufK7tuS9QVUoEXA1nOnnDOTLZ0Oo6G3G dJ0I0l2Ww/sHGZpS4w/Q9khPpI8cM1xEcN0dqHffLGw3dZPBI2C812YveWNspfYvOoS6D4 FWuqHghmuS0HBj+d5pzrTUREeFAh0yULBV1p0P+2sUklM+n5p1L1+qtNs2X2MulvNgrkHm scwl8ebDe+BniStfErp2XtEldWUB6YdX1wHc1cqb+V4JnxzLWkBidgpv7/T1vVb/B/fyF4 bzulRSWoPnJF49f6fCrzqCP9N2jVmEAfjGJHHMpRVSrDPrf5qjMY0zhBPN5wAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WJTDFc7u; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716553290; a=rsa-sha256; cv=none; b=JRfJzfA3pVOd0nMzvAFmVP9N+3UlXurCA1Dw5m8m712psfw3ghTXLA9TaeADmb+Dnw3ubZ YFsoNPtgYbn6c4z9TLJElLDTrYjQmzHcHfb/wWvDQEVCXz7srG7spO2ggsB7w77k7ap/tc 6CeIaAXm3d1mx76cCiKmM4qaTet6pAdEkj3v/SJkI1LbTHqSKSHHuG6GAttFCIul0ybO9k LjHUTkcpQRs9wQWRUwJMCwuhbu/GkQTgmyW6jvztsxQe6XFe/2xz2ZajCwOBdO2Nnc1/0r 3GBeDs47ZuOSMKFiByG/Q6fTs5sBeblYrTyUhcZjwhj7d6vJT/eGqx2uRDdc0Q== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6CC626AA6C for ; Fri, 24 May 2024 14:21:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sATuQ-00008S-DL; Fri, 24 May 2024 08:20:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sATuO-00008D-Ne for emacs-orgmode@gnu.org; Fri, 24 May 2024 08:20:28 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sATuE-0000DS-5D for emacs-orgmode@gnu.org; Fri, 24 May 2024 08:20:28 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2D3EE240103 for ; Fri, 24 May 2024 14:20:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716553213; bh=Upn5/N0SwZYAPF68mN2bmKuGGQ5rCEegWspAXAUuGzg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=WJTDFc7u1PvRyUMoYBzrbU4DNlxn7JrxajVQ6nTuN8iFt8F9hBPGwiu12AvsVSZqM YQDsm53v8SoeVfH4zjufRVgy2lfgpY1WmH1Q3qdv+5M+o+QftXzan0+6VJzdwlsktR Fl+ISVJLFL1ns2zUsSB95C6rviWCkb6Qv580TNNa3dpzrwmGQW1QtYO+O4UO7k22/k WvsAMhxA5njJxqd4XZu5KCDxHdBS9jmEX79opUO0IkGRNyYnYF+SfwwlLBnNHzRGmc a1xFSr1DXmLiv1GO8iCbH4j5VeHEgMpKiD37hcvJze/MaaZ6A3wQaK8Fp3uZMzU9Dd GsBKMAsgArwqg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Vm3yh06M5z9rxF; Fri, 24 May 2024 14:20:11 +0200 (CEST) From: Ihor Radchenko To: Visuwesh Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-plot: Unable to use text xtics with type:2d (+ more) [9.7-pre (N/A @ /home/viz/lib/emacs/straight/build/org/)] In-Reply-To: <87cypbjw50.fsf@gmail.com> References: <87cypbjw50.fsf@gmail.com> Date: Fri, 24 May 2024 12:21:57 +0000 Message-ID: <871q5rv1qy.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.57 X-Migadu-Queue-Id: 6CC626AA6C X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.57 X-TUID: uX1C0QUbfkCl Visuwesh writes: > Unless I misunderstood the code, the line > > ;; Check type of ind column (timestamp? text?) > (when (plist-get params :check-ind-type) > > should be > > ;; Check type of ind column (timestamp? text?) > (when (plist-get (cdr type) :check-ind-type) > > because (1) org-plot/collect-options only adds a select number of > keywords to the plist and :check-ind-type is not a part of the select > members, and (2) org-plot/gnuplot is never called with a non-nil value > for the optional argument PARAMS in tree. I do not think that it is right. AFAIU, the idea is that `org-plot/preset-plot-types' provides some default options, but the user can overwrite these defaults in the #+PLOT line. What you propose will disregard the values of :set :line :map :title :file :ind :timeind :timefmt :textind :deps :labels :xlabels :ylabels :xmin :xmax :ymin :ymax :ticks if they are customized by user in `org-plot/preset-plot-types'. I believe that the right way to address the problem will be `org-combine-plists' on the (1) org-plot/preset-plot-types; (2) org-plot/gnuplot-default-options; (3) #+PLOT lines in the buffer. > BTW, the earlier check in the function for :data-dump should also fail > because > > (plist-get (assoc 'grid org-plot/preset-plot-types) :data-dump) ;; = =3D> nil > > but > > (plist-get (cdr (assoc 'grid org-plot/preset-plot-types)) :data-dump)= ;; =3D> non-nil > > where type =E2=89=A1 (assoc 'grid org-plot/preset-plot-types) in > org-plot/gnuplot. > > [ I cannot reproduce the grid example in worg's org-plot.org file, but > even with the fix, I cannot reproduce it; more below. ] Your concern is valid here. The code is indeed not right. > The other code smell I see is that the function checks for the PLOT line > twice. Once near the beginning of the function, and once just after the > cleaning up of hline. Is this simply an oversight? It is kinda intentional, but broken. Historically, users can put #+PLOT lines _after_ the table. However, after refactoring org-table.el, this is no longer working. See https://list.orgmode.org/orgmode/87o7a0p9ba.fsf@localhost/ > Coming to the grid example, the doc-string of org-plot/preset-plot-types > options says: > > - :data-dump - Function to dump the table to a datafile for ease of > use. > > Accepts lambda function. Default lambda body: > (org-plot/gnuplot-to-data table data-file params) > > but in fact, org-plot/gnuplot passes one more argument to the :data-dump > function: > > ;; Dump table to datafile > (let ((dump-func (plist-get type :data-dump))) > (if dump-func > (funcall dump-func table data-file num-cols params) > (org-plot/gnuplot-to-data table data-file params))) > > but here's the catch: the :data-dump function in the grid option expects > the order > > (lambda (table data-file params _num-cols) > > which breaks things down the line. What should be the actual order > here? I looked at the history of those lines briefly using C-x v h but > I don't have the time to look into it properly to decide on the actual > argument order. The best order is de-facto calling convention in the code: (funcall dump-func table data-file num-cols params) The docstring and the default value should be fixed accordingly. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at