X-Received: by 2002:a6b:cf17:: with SMTP id o23-v6mr5653202ioa.30.1541731394668; Thu, 08 Nov 2018 18:43:14 -0800 (PST) X-Received: by 2002:aca:50c4:: with SMTP id e187-v6mr3081oib.7.1541731394397; Thu, 08 Nov 2018 18:43:14 -0800 (PST) Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!z5-v6no1157183ite.0!news-out.google.com!n199-v6ni1549itn.0!nntp.google.com!z5-v6no1157181ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Thu, 8 Nov 2018 18:43:14 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=134.7.58.59; posting-account=t7HSDAoAAADl3mmKT_nPfhxWxoL5AyFC NNTP-Posting-Host: 134.7.58.59 References: <6eaf3631-1502-4e26-9228-487ece8e7bfc@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6048c840-e241-4a9c-9a55-e167d892b645@googlegroups.com> Subject: Re: dgrid3d and logscale xy with gridded data From: rowlesmr@gmail.com Injection-Date: Fri, 09 Nov 2018 02:43:14 +0000 Content-Type: text/plain; charset="UTF-8" Lines: 73 Xref: csiph.com comp.graphics.apps.gnuplot:4054 On Thursday, 8 November 2018 18:17:08 UTC+8, Karl Ratzsch wrote: > Am 08.11.2018 um 09:22 > > Hi all > > > > I have some grid data which I would like to plot as a surface. I want the xy axes to be logscale. > > > > I would like to interpolate the data onto a finer grid so that I can have nice contours and that the colour gradient looks nicer. > > > > As far as I can tell, it looks like dgrid3d does the gridding in linear space, and then logscale does the axis conversion. > > > > How can I grid the data in log space? > > > > I would say don't logscale the axes, but plot the logarithmised (is that > an adjective?) data: > > reset > set dgrid3d splines 60,60 > splot "dat.txt" using (log10($1)):(log10($2)):3 w l > > If you want your regular (nonlog) axis ticlabels back, you can manually > relabel them, or perhaps someone else can help with getting the linked > > set link x2 via 10**x inverse log10(x) > set link y2 via 10**y inverse log10(y) > > x2 and y2 axes to show. Not sure how/if that works. > > Karl Thanks for the inspiration Karl I bodged together the following script. The only thing that would need tweaking is to change the size of the "minor" tics to make the major divisions stand out. Script: set print "-" set encoding iso_8859_1 set terminal postscript landscape noenhanced color 16 set output "figure.ps" set key autotitle columnhead set dgrid3d 50,50 splines set pm3d set pm3d map set cntrparam levels auto set contour surface set xlabel "Maximum intensity" set ylabel "Step size" #set xrange [2:6] #setting this makes the image finish at the y2 tics, without changing the xtics set xtics 2,1,6 unset xtics # "major" tics set xtics ("100" 2, "1000" 3, "10000" 4, "100000" 5, "1e6" 6) # "minor" ticks set for [i=2:6:1] xtics add ("" log10(2*10**i),"" log10(3*10**i),"" log10(4*10**i),"" log10(5*10**i), "" log10(6*10**i),"" log10(7*10**i),"" log10(8*10**i),"" log10(9*10**i)) set ytics -2,1,-1 unset ytics set ytics ("0.01" -2, "0.1" -1) set for [i=-3:0:1] ytics add ("" log10(2*10**i),"" log10(3*10**i),"" log10(4*10**i),"" log10(5*10**i), "" log10(6*10**i),"" log10(7*10**i),"" log10(8*10**i),"" log10(9*10**i)) splot "test_data.dat" using (log10($1)):(log10($2)):3 !ps2pdf figure.ps figure.pdf