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


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

Re: Need to add colour and "chop" off some output

Newsgroups comp.graphics.apps.gnuplot
Date 2014-04-21 08:39 -0700
References <38f03dd9-d9f9-464e-8055-1ba78f43639c@googlegroups.com> <lj1d4r$rav$1@news.rz.uni-karlsruhe.de>
Message-ID <ab195ada-3592-4be5-aef3-188c7e2081ba@googlegroups.com> (permalink)
Subject Re: Need to add colour and "chop" off some output
From "Dr. David Kirkby" <drkirkby@gmail.com>

Show all headers | View raw


On Sunday, 20 April 2014 22:10:23 UTC+1, Karl  wrote:
> Am 20.04.2014 22:33, schrieb Dr. David Kirkby:
> 
> > 1) When I set the terminal to "postscript", it is all in black and white. 
> > How can I specify the colour of the lines? I have tried the obvious things, to me, but they fail to work. 
> postscript terminal is monochrome by default, see "help postscript".
> Just give it the "colour" parameter


Thank you Karl. I seem to have succeeded in changing the colour, but the line is changing from solid to dashed. 
> 
> > 2) All the lines in on a Smith Chart should be contained within a circle,
> You could add a filter function to block points with r > 1, e.g. 
>   filt(u,v) = (sqrt(u**2 + v**2) > 1 ? NaN : u)

Thank you. I understand what that is trying to achieve, making it NaN if the radius sqrt(u*u+v*v) is greater than 1. But it does not seem to be achieving the desired effect. See the result at 

http://www.vnacalibration.co.uk/tmp/improved-but-not-quite-right.png
compared to what I am trying to achieve at 
http://www.vnacalibration.co.uk/tmp/simple-what-I-want.png

I do have a couple of other issues too. 

1) There is a square around the outside in black. How do I get rid of that? 

2) I don't want any tics on the x or y axes. If I use "unset xtics" it gets rid of them on the x-axis, and if I use "unset ytics", it gets rid of them on the y-axis. If however I unset both xtics and ytics, the image rotates by 90 degrees. I note the code I copied has the command "norotate" in both xtics and ytics, but when I remove both, that is being removed of course, and the the whole thing rotates by 90 degrees. 


3) I don't have a horizontal line in red, which should go from one side to the other. This is an arc of infinite radius of course, though there must be a better way of drawing it! I suspect I can work that out myself. 

This is the code what I have. Any suggestions for improvement would be most welcome. 

# set terminal pngcairo  transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 
# set output 'poldat.1.png'
set terminal postscript
set clip points
set dummy t,y
unset key
set parametric
set size ratio 1 1,1
# set xtics axis in scale 1,0.5 nomirror norotate  offset character 0, 0, 0 autojustify
# set ytics axis in scale 1,0.5 nomirror norotate  offset character 0, 0, 0 autojustify
unset xtics
set ytics norotate  nomirror
set rrange [ 0.00000 : 10.0000 ] noreverse nowriteback
set trange [ -3.14159 : 3.14159 ] noreverse nowriteback
set xrange [ -1.00000 : 1.00000 ] noreverse nowriteback
set yrange [ -1.00000 : 1.00000 ] noreverse nowriteback
set style line 1 lt rgb "red" lw 10
set style line 2 lt rgb "green" lw 10 

tv(t,r) = sin(t)/(1+r)
tu(t,r) = (cos(t) +r)/(1+r)
cu(t,x) = 1 + cos(t)/x
cv(t,x) = (1+ sin(t))/x
GPFUN_tv = "tv(t,r) = sin(t)/(1+r)"
GPFUN_tu = "tu(t,r) = (cos(t) +r)/(1+r)"
GPFUN_cu = "cu(t,x) = 1 + cos(t)/x"
GPFUN_cv = "cv(t,x) = (1+ sin(t))/x"
filt(u,v) = (sqrt(u**2 + v**2) > 1 ? NaN : u) 
# plot cu(t,.1),cv(t,.1),cu(t,.1),-cv(t,.1),cu(t,1),cv(t,1),cu(t,1),-cv(t,1),cu(t,10),cv(t,10),cu(t,10),-cv(t,10),tu(t,.1),tv(t,.1),tu(t,.5),tv(t,.5),tu(t,1),tv(t,1),tu(t,5),tv(t,5),tu(t,10),tv(t,10),cu(t,.5),cv(t,.5),cu(t,.5),-cv(t,.5),tu(t,0),tv(t,0) 

plot filt(cu(t,.1),cv(t,.1)),cv(t,.1) ls 1, \
     filt(cu(t,.1),-cv(t,.1)),-cv(t,.1) ls 1, \
     filt(cu(t,1),cv(t,1)),cv(t,1) ls 1 , \
     filt(cu(t,1),-cv(t,1)),-cv(t,1) ls 1, \
     filt(cu(t,10),cv(t,10)),cv(t,10) ls 1, \
     filt(cu(t,10),-cv(t,10)),-cv(t,10) ls 1, \
     filt(tu(t,.1),tv(t,.1)),tv(t,.1)  ls 2, \
     filt(tu(t,.5),tv(t,.5)),tv(t,.5)  ls 2, \
     filt(tu(t,1),tv(t,1)),tv(t,1)  ls 2, \
     filt(tu(t,5),tv(t,5)),tv(t,5)  ls 2, \
     filt(tu(t,10),tv(t,10)),tv(t,10)  ls 2 , \
     filt(tu(t,10),tv(t,10)),tv(t,10)  ls 2 , \
     filt(cu(t,0.5),cv(t,0.5)),cv(t,0.5)  ls 1 , \
     filt(cu(t,0.5),-cv(t,0.5)),-cv(t,0.5)  ls 1 , \
     filt(tu(t,0),tv(t,0)),tv(t,0)  ls 2 


Dave

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


Thread

Need to add colour and "chop" off some output "Dr. David Kirkby" <drkirkby@gmail.com> - 2014-04-20 13:33 -0700
  Re: Need to add colour and "chop" off some output Karl <mail.kfr@gmx.net> - 2014-04-20 23:10 +0200
    Re: Need to add colour and "chop" off some output "Dr. David Kirkby" <drkirkby@gmail.com> - 2014-04-21 08:39 -0700
      Re: Need to add colour and "chop" off some output Karl <mail.kfr@gmx.net> - 2014-04-21 18:28 +0200

csiph-web