Back to demo index

gnuplot demo script: cities.dem

autogenerated by webify.pl on Sat Oct 1 21:49:11 2022
gnuplot version gnuplot 5.4 patchlevel 5
Your browser does not support the HTML 5 canvas element
          # unzoom rezoom zoom text ?
     
#
# Demonstrates how to derive variable font size from a data file column.
# 
# If you are viewing this via the HTML canvas terminal, be sure to toggle
# the font scaling icon so that the fonts change size as you zoom in.
#
Scale(size) = 0.25*sqrt(sqrt(column(size)))
CityName(String,Size) = sprintf("{/=%d %s}", Scale(Size), stringcolumn(String))

set termoption enhanced
save_encoding = GPVAL_ENCODING
set encoding utf8
unset xtics
unset ytics
unset key
set border 0
set size square
set datafile separator "\t"
plot 'cities.dat' using 5:4:($3 < 5000 ? "-" : CityName(1,3)) with labels

Click here for minimal script to generate this plot