From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Examples of use of svg.el? Date: Sat, 02 Apr 2022 03:21:20 +0200 Message-ID: <87tubcxotr.fsf@web.de> References: <878rsozdb2.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40090"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:YHKMUbYE03Kk0hYkrCfktR5l9S4= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 02 03:21:52 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1naSSd-000AIS-Id for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Apr 2022 03:21:51 +0200 Original-Received: from localhost ([::1]:37852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naSSc-0003Il-C4 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 01 Apr 2022 21:21:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naSSH-0003Ic-6Q for help-gnu-emacs@gnu.org; Fri, 01 Apr 2022 21:21:29 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:57526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naSSF-0000fc-ND for help-gnu-emacs@gnu.org; Fri, 01 Apr 2022 21:21:28 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1naSSE-0009rn-7u for help-gnu-emacs@gnu.org; Sat, 02 Apr 2022 03:21:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136827 Archived-At: Eduardo Ochs writes: > x0 = 3 > y0 = 2 > z = z(x,y) = (x-x0)^2 - (y-y0)^2 + 2 > > How would you make Calc plot it for x in [x0-1,x0+1] and y in > [y0-1,y0+1]? Also: how do we access the script that Calc sends to > gnuplot? > [...] > I would _really_ love to make something similar for Calc. Any help > would be greatly appreciated! Calc is a cool interactive Calculator, but IMHO it's not so super useful as programming language or for writing scripts, and it seems that's what you want to do. With my current Calc skills I would solve the above task like ' [x0-1 .. x0+1] RET ; interval ' [y0-1 .. y0+1] RET ; ditto ' (x-x0)^2 - (y-y0)^2 + 2 ; you could alternatively define a named function 3 s t x0 ; set x0 to 3 2 s t y0 ; ditto y0 to 2 M-3 = ; updates topmost 3 stack values with vars substituted g F ; draw it There are probably better ways to handle the constants x0 and y0. You can undo the variable substitution with `undo' (surprise!). g v and g V show communication stuff with gnuplot. g N to use more interpolation points (the default is, dunno, 4 or so, you probably want to change the default in your config: `calc-graph-default-resolution' and `calc-graph-default-resolution-3d'). That's all I know. If you are already happy with Maxima, Calc will probably not be a complete substitute. Michael.