Return-Path: Received: from funet.fi by lazy.qt.IPA.FhG.de with SMTP (5.61+/IDA-1.2.8/gandalf.2) id AA08341; Wed, 10 Jun 92 07:53:54 +0200 Received: from santra.hut.fi by funet.fi with SMTP (PP) id <29569-0@funet.fi>; Wed, 10 Jun 1992 08:44:29 +0300 Received: from joker.cs.hut.fi by santra.hut.fi (5.65c/8.0/TeKoLa) id AA10220; Wed, 10 Jun 1992 08:42:21 +0300 Received: by joker.cs.hut.fi (5.65b/6.8/S-TeKoLa) id AA12590; Wed, 10 Jun 92 08:41:52 +0259 Received: from relay2.UU.NET by joker.cs.hut.fi (5.65b/6.8/S-TeKoLa) id AA12557; Wed, 10 Jun 92 08:38:49 +0259 Received: from world.std.com by relay2.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA26986; Wed, 10 Jun 92 01:38:59 -0400 Received: by world.std.com (5.61+++/Spike-2.0) id AA13768; Wed, 10 Jun 92 01:38:59 -0400 Date: Wed, 10 Jun 92 01:38:59 -0400 From: jrs@world.std.com (Rick Sladkey) Message-Id: <9206100538.AA13768@world.std.com> Sender: owner-linux-activists@niksula.hut.fi To: linux-activists@niksula.hut.fi X-Note1: Remember to put 'X-Mn-Key: normal' to your mail body or header Cc: linux-activists@joker.cs.hut.fi Subject: gnuplot_x11 In-Reply-To: <199206091859.AA04063@santra.hut.fi> References: <199206091859.AA04063@santra.hut.fi> X-Mn-Key: X11 >>>>> On Tue, 09 Jun 92 19:22:16 +0100, mfd1%ukc.ac.uk@FINHUTC.hut.fi said: Mitch> has anyone gotten gnuplot to work with X with SPLOTS ?? Yes, but it took some work... Mitch> Well I tried compiling it with the linux defs in as well (so it Mitch> works without X11 also i.e. with vgalib) and it compiles ok, Mitch> even the gnuplot_x11 but when it runs and I try to do a surface Mitch> plot I get big patches of color all over the plot (usually Mitch> black). This also happens with hidden line removal! I had exactly this problem. Mitch> So what am I doing wrong, and is this a gcc or X11 problem ?? Well, if I knew much about X, I might be able to figure out what the source of the problem is. But since I don't, I'll just say what I did to fix it. gnuplot talks to gnuplot_x11 through a pipe so I wrote all the output to a debug file and then experimented with sending variations of the file directly to gnuplot_x11. I discovered that the line-type command was at fault. gnuplot uses line-types -2 and -1 to represent borders or axes or something and types 0 through 7 (?) for different colors. Types -2 and -1 cause gnuplot_x11 to use a X11 line-width of 2 instead of 0. I suppose this is meant to select 2 pixel-wide lines but they come out more like 2 inches wide... Anyway, here is the relevant patch. Rick Sladkey jrs@world.std.com ----- diff -rc ../gnuplot.orig/gnuplot_x11.c ./gnuplot_x11.c *** ../gnuplot.orig/gnuplot_x11.c Mon Sep 9 20:13:19 1991 --- ./gnuplot_x11.c Tue May 26 21:51:59 1992 *************** *** 202,209 **** --- 202,214 ---- /* X11_linetype(type) - set line type */ else if (*buf == 'L') { sscanf(buf, "L%4d", <); + #if linux + lt = (lt+2)%10; + width = 0; + #else lt = (lt%8)+2; width = (lt == 0) ? 2 : 0; + #endif if (Color) { if (lt != 1) type = LineSolid;