Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #4054

Re: dgrid3d and logscale xy with gridded data

Newsgroups comp.graphics.apps.gnuplot
Date 2018-11-08 18:43 -0800
References <6eaf3631-1502-4e26-9228-487ece8e7bfc@googlegroups.com> <ps12f2$7tj$1@solani.org>
Message-ID <6048c840-e241-4a9c-9a55-e167d892b645@googlegroups.com> (permalink)
Subject Re: dgrid3d and logscale xy with gridded data
From rowlesmr@gmail.com

Show all headers | View raw


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


Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

dgrid3d and logscale xy with gridded data rowlesmr@gmail.com - 2018-11-08 00:22 -0800
  Re: dgrid3d and logscale xy with gridded data Karl Ratzsch <mail.kfr@gmx.net> - 2018-11-08 11:17 +0100
    Re: dgrid3d and logscale xy with gridded data rowlesmr@gmail.com - 2018-11-08 18:43 -0800

csiph-web