gnuplot,highlight,radar-chart , How to highlight regions of plot with gnuplot


How to highlight regions of plot with gnuplot

Question:

Tag: gnuplot,highlight,radar-chart

I'd appreciate if somebody can help with this question. I am working with a radar (or spiderweb) plot with gnuplot 5.0.0:

enter image description here

The scale and range in all axes is the same. The numbers at and beyond 1 have a special meaning and I would like to highlight that.

I am thinking of three things that would increase visibility:

  1. Simply make the tick mark at 1 (labelled "Limit") boldfaced. How could I highlight just a specific tick and label?

  2. I could also highlight the circular dashed line at level 1

  3. On the plot itself I'd like to have the background colored differently for radius > 1.

How can I achieve either of the three options above? All three would be ideal of course, but just a a minimum differentiation from the rest of that value would help.

This is what generated the plot in the link:

set term x11
set title "My title "
set polar
set angles degrees
npoints = 6

a1 = 360/npoints*1
a2 = 360/npoints*2
a3 = 360/npoints*3
a4 = 360/npoints*4
a5 = 360/npoints*5
a6 = 360/npoints*6

set grid polar 360
set size square
set style data lines

unset border

set grid ls 0
set linetype 1 lc rgb 'red' lw 2 pt 7 ps 2

M=2.2
set arrow from 0,0 to first M*cos(a1), M*sin(a1)
set arrow from 0,0 to first M*cos(a2), M*sin(a2)
set arrow from 0,0 to first M*cos(a3), M*sin(a3)
set arrow from 0,0 to first M*cos(a4), M*sin(a4)
set arrow from 0,0 to first M*cos(a5), M*sin(a5)
set arrow from 0,0 to first M*cos(a6), M*sin(a6)

a1_min = 0
a1_max = 1
a2_min = 0
a2_max = 1
a3_min = 0
a3_max = 1
a4_min = 0
a4_max = 1
a5_min = 0
a5_max = 1
a6_min = 0
a6_max = 1

set label "M1" at M*cos(a1),M*sin(a1) center offset char 1,1
set label "M2" at M*cos(a2),M*sin(a2) center offset char 1,1
set label "M3" at M*cos(a3),M*sin(a3) center offset char 1,1
set label "M4" at M*cos(a4),M*sin(a4) center offset char 1,1
set label "M5" at M*cos(a5),M*sin(a5) center offset char 1,1
set label "M6" at M*cos(a6),M*sin(a6) center offset char 1,1


set xrange [0:1]
set yrange [0:1]

set xtics axis 0,0.5,M
unset ytics

set rrange [0:M]

set rtics (""0,""0.25,""0.5,""0.75,"Limit"1,""1.25,""1.50,""1.75,""2)
set rtics scale 0 format ''

set style fill transparent solid 0.5
set style function filledcurves y1=0.5
set grid noxtics nomxtics noytics nomytics front


plot  '-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 1 title "AAA",\
 '-' u ($1==1?a1:($1==2?a2:($1==3?a3:($1==4?a4:($1==5?a5:($1==6?a6:$1)))))):($1==1?(($2-a1_min)/(a1_max-a1_min)):($1==2?(($2-a2_min)/(a2_max-a2_min)):($1==3?(($2-a3_min)/(a3_max-a3_min)):($1==4?(($2-a4_min)/(a4_max-a4_min)):($1==5?(($2-a5_min)/(a5_max-a5_min)):($1==6?(($2-a6_min)/(a6_max-a6_min)):$1)))))) w filledcurve lt 2 title "BBB"

1 2.1
2 1
3 0.1
4 0.5
5 0.5
6 0.1
1 2.1
EOF
1 2.2
2 0.9
3 0.9
4 0.2
5 0.3
6 0.1
1 2.2
EOF
set output

Answer:

I've taken the liberty to streamline your script a bit, you can now easily adjust the number of arms in the web. Also added a coloured background for 1 >r > M.

Btw., there is no need to enter the first datapoint again at the end to close the contour. Update: That is, there shouldn't be. However the line between the last and first point is missing then, even with giving the "closed" option to "with filledcurve". I wonder if this is a bug.

set term wxt
set title "My title "
set polar
set angles degrees

set grid polar 360
set size square
set style data lines
set key top left

unset border

set grid ls 0
set linetype 1 lc rgb 'red' lw 2 pt 7 ps 2

M=2.2
npoints = 7

minima = "0 0 0 0 0 0 0" # adjust and add more as necessary
maxima = "1 1 1 1 1 1 1"

a(n) = 360./npoints*n
amin(n) = 0.0 + word(minima,int(n))
amax(n) = 0.0 + word(maxima,int(n))

do for [i=1:npoints] {
    set arrow i from 0,0 to first M*cos(a(i)), M*sin(a(i))
    set label i sprintf("M%.f",i) at M*cos(a(i)),M*sin(a(i)) \
        center offset char 1,1
}

set object 1 circle at 0,0 size M fillc rgb "yellow" behind
set object 2 circle at 0,0 size 1 fillc rgb "white" behind

set xrange [0:1]
set yrange [0:1]

set xtics axis 0,0.5,M
unset ytics

set rrange [0:M]

set rtics (""0,""0.25,""0.5,""0.75,"{/:Bold Limit}"1,""1.25,""1.50,""1.75,""2)
set rtics scale 0 format ''

set style fill transparent solid 0.5
set style function filledcurves y1=0.5
set grid noxtics nomxtics noytics nomytics front

plot '-' us (a($1)):(($2-amin($1))/(amax($1)-amin($1))) \
        w filledcurve closed lt 1 title "AAA",\
     '-' us (a($1)):(($2-amin($1))/(amax($1)-amin($1))) \
         w filledcurve closed lt 2 title "BBB"

1 2.1
2 1
3 0.1
4 0.5
5 0.5
6 0.1
7 0.5
EOF
1 2.2
2 0.9
3 0.9
4 0.2
5 0.3
6 0.1
7 1.8
EOF

Related:


gnuplot conditional plotting with if


gnuplot
I have a data file with two columns 10 0.5 20 0.8 25 0.3 15 0.6 I want to plot the second column if the first column is less than or equal 20. Problem is, I want to skip the rows where the first column is greater than 20, however...

Generating a Heatmap Table in gnuplot


matrix,gnuplot,heatmap
I am trying to generate a Heatmap with gnuplot but with a two distinct information for each entry in the heatmap. While heatmap shows the value as color, I want each block in the heatmap to show textual information as well. The following script creates half of what I have...

gnuplot - splot inline data and point labels


gnuplot,labels
Hi Im using this data to get a 3d/2d like histogram. I want to label each histogram column with a 'dx cx' label preferable on top of the column. With my example the graph is drawing correctly, but there are no labels. if I'm using only the using 1:2:3:4 with...

How to make gnuplot to NOT plot multiple lines?


plot,scripting,gnuplot
I am plotting some data and I am getting multiple lines streaking across the plot. There should be one line, so I imagine that gnuplot is trying to fit the data and is joining points or something in a strange way. How can I get gnuplot to plot one like...

gnuplot highlighting points when with lines


plot,gnuplot,highlight
I have 4 points I would like to plot using gnuplot, but with lines. The problem is, I can't find how to highlight these 4 points on the drawn line. I would like for the plot to be a line through the points, but that these points are also clearly...

Running gnuplot from Fortran program under Windows


windows,fortran,gnuplot
I need to make a Fortran program(.exe) that analyses data and builds a plot. I've decided to do this by calling gnuplot from my Fortran program along with a gnuplot settings file. When I do this from Windows Command Line: wgnuplot -persist input.txt it works fine. But when I call...

highlight “partial” duplicates across entire sheet in Google Sheets using conditional formatting


formatting,duplicates,conditional,highlight,partial
Im trying to highlight partial duplicates in google sheets using conditional formatting. I need to highlight duplicates across multiple columns and rows in any matching cells. so far I'm using this... =countif(INDIRECT({"C2:Z18"}),C2)>1 Which works to a degree, but it only highlights exact matches. I need to find a way to...

Does anyone know how to get rid of the “small bar” in a gnuplot graph?


gnuplot
Below is my gnuplot code. set term pdf enhanced set output "plot/test.pdf" set datafile separator "," set xtics norangelimit set ytics nomirror set termoption dashed set xlabel "times" set yrange [0:100] set xtics nomirror set grid ytics set key right bottom plot 'plot/test.csv' using 2:xtic((int($0)%20)==0?sprintf("%d", $0*10):"") title "Comparing with the...

How do I skip rows in Gnuplot when plotting a heat map?


gnuplot,heatmap
I'm trying to plot a heat map in Gnuplot: set view map set size square set cbrange [0:1] splot "input.dat" 1:4:8 w pm3d But I want to skip the rows with the data in the first & fourth column in a particular range without changing xrange and yrange. How can...

How to get labels on top of bars in gnuplot


gnuplot
I want a barchart with labels on top of the bars, showing a group of bars, with errors, and labels on top of the bars indicating how much this bar differs from the first one. Although i get the positioning about right, it is always a little off. Y seems...

GNUPLOT contour over splot with pm3d from different data files


gnuplot,contour
i am struggling in trying to splot a nonuniform binary matrix from a datafile1, and plot over it a contour of another variable, over the same grid but another datafile. Both the datafiles are in binary matrix shape. # CONTOUR SETTINGS set contour surface set cntrparam level discrete 0.3,0.067 #...

Highlighting specific ranges on a Graph in R


r,graph,highlight
library(season) plot(CVD$yrmon, CVD$cvd, type = 'o',pch = 19,ylab = 'Number of CVD deaths per month',xlab = 'Time') if i wanted to highlight a region of the graph based on x values say from 1994-1998 how do i do this? Any thought would be appreciated Thanks....

Offset gnuplot grid lines so that they match xtics


gnuplot
How do I move the vertical grid lines so that they match the horizontal labels/xtics? In the following image, the vertical grid lines don't line up with the xtics: I tried setting the xtics offset before setting the grid, but that doesn't seem to work.Here's my current script: #!/usr/bin/gnuplot -persist...

gnuplot rowstacked histogram: how to put sum above bars


label,gnuplot,histogram
This question is related to gnuplot histogram: How to put values on top of bars. I have a datafile file.dat: x y1 y2 1 2 3 2 3 4 3 4 5 and the gnuplot: set style data histogram; set style histogram rowstacked; plot newhistogram 'foo', 'file.dat' u 2:xtic(1) t...

Can I plot times when they're given as UNIX timestamps with added milliseconds?


datetime,gnuplot
I'm using gnuplot 4.4 on CentOS 6.6. I've found many examples online showing that the following (note the use of %.3S) will enable timestamps like "12:42:51.047" to be parsed and used as X axis values: set xdata time set format x "%H:%M:%.3S" set timefmt "%H:%M:%S" However, my input is not...

Gnuplot plotting all datafiles automatically


bash,gnuplot
I have multiple *.data files each has same format and can be plotted with this simple script: cat << __EOF | gnuplot -persist set terminal pdf set output 'out.pdf' set datafile separator ";" set boxwidth 0.5 set style fill solid plot "xxx.dat" using 1:3:xtic(2) with boxes __EOF How can i...

How to highlight regions of plot with gnuplot


gnuplot,highlight,radar-chart
I'd appreciate if somebody can help with this question. I am working with a radar (or spiderweb) plot with gnuplot 5.0.0: The scale and range in all axes is the same. The numbers at and beyond 1 have a special meaning and I would like to highlight that. I am...

How to select subplot in gnuplot multiplot mode


gnuplot,subplot
is there any way to select a subplot in gnuplot's multiplot mode as in subplot(n,m,x) in Matlab where x is the one I want to plot at? I am plotting three points using linespoints on a graph in red color at first, then I want to plot a single point...

GNUplot: How to make a plot unclosed?


gnuplot
I'm drawing plots from a file in gnuplot like this: plot "plots.txt" using 1:2 with lines lw 2 and I get something like this: How can I draw a plot without enclosing it (without the line connecting the leftmost and the rightmost points)? Thank you!...

Gnuplot: Conditional splot of a function


conditional,gnuplot
I want to splot the function exp(-(x²+y²)) alone and under the constraint of x+y-1=0. The result should be the surface alone as well as a line with a maximum at x=y=0.5. Or in other words, it's the intersection of the function with a (110)-plane. What I came up so far...

about drawing sinus function in gnuplot when it is pressed a keyboard


gnuplot
Is it possible to draw sinus function on the interval: [-2*pi, 2*pi] in the following way: when I press right arrow on the keyboard to produce sinus function on the interval: [-2*pi, -pi] when I press again to plot sinus function on the interval [-pi, 0] .... Is it possible?...

How to output smooth cspline curve as a data file


output,gnuplot,smooth
Does anybody know how to extract some data of smooth cspline curve for a given data? For instance, there is a data file which has 2 columns corresponding to x and y values. I can draw the data with smooth cpline curve by the following commands p 'data' w lp,...

how to automatically sort the x values in gnuplot


sorting,gnuplot
When I try to plot something with linespoints, unless the values that go to the x axis are already sorted within the file, each point gets connected to the point that is on the next line of the file: Only when I sort the values in the file I can...

C++ Gnuplot pipe input from C++ defined variables


c++,pipe,gnuplot
I am using C++ to pipe commands to gnuplot using the following code: FILE *gnuplotPipe = popen("gnuplot -persist", "w"); // Open a pipe to gnuplot if (gnuplotPipe) { // If gnuplot is found fprintf(gnuplotPipe, "reset\n"); //gnuplot commands fprintf(gnuplotPipe, "n='500'\n"); fprintf(gnuplotPipe, "max='1500'\n"); fprintf(gnuplotPipe, "min='-1500\n"); fprintf(gnuplotPipe, "width=(max-min)/n\n"); fprintf(gnuplotPipe, "hist(x,width)=width*floor(x/width)+width/2.0\n"); fprintf(gnuplotPipe, "set term...

Set with lines in gnuplot


gnuplot
I can connect the dots of a data file by including with lines in the plot command. Is there a way to set this fixed (I was hoping for set with lines) so I don't have to explicitly include it in every call of plot?

Plotting multiple columns with a for loop in gnuplot, key doesn't work


for-loop,gnuplot
I have file with many columns that I'd like to plot as follows: plot for [i=1:30] 'test' using 1:i w lp This gives the plot I want, but when I do set key, then the key I see has all lines labeled as 1:i: How can I make this output...

Animating a single data file using gnuplot


animation,gnuplot
I use FORTRAN 77 code to generate data (saved as filename.dat) of simple physics situations containing x-y co-ordinates like a projectile. My data files usually have 2 or 3 columns like so: 1 1 2 2 3 3 4 4 5 5 I can plot (2d and 3d) using Gnuplot...

How to highlight rulerformat


vim,highlight,rc
I want highlight the rulerformat in my .vimrc. I have set ruler set rulerformat=%55(%{strftime('%a\ %b\ %e\ %I:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%) I have subsequently tried all of the following: hi rulerformat ctermbg=1 hi rulerformat ctermbg=red hi Group1 ctermbg=red "if you modify the rulerformat slightly you can try to access group 1...

How to plot columns numbered greater than 1000 in gnuplot


plot,gnuplot
I have a file with 1600 columns. plot "file" using 1:999 title columnhead(999) plots column 999, but plot "file" using 1:1000 title columnhead(1000) produces column 100 instead of 1000, producing the same result as plot "file" using 1:100 title columnhead(100) Apparently large column numbers are wrapped. Is there a work-around...

Define font style as a variable


gnuplot
Is it possible to define different font styles (in gnuplot), so that I can refer to them later by an index instead of repeating them all every time, for example: font1 = font "Helvetica,12" ; font2 = font "Verdana, 12" and so on

Gnuplot: Fitting asymptotic curve to data


gnuplot
I am trying to fit an asymptotic curve to my data using gnuplot. It is a dataset showing reaction time results over a testing period. I have been able to plot the data and fit a straight line through it using the following code. f(x) = a*x + c; fit...

gnuplot - get errors on fit parameters, get fit output values as variables, print variable to screen


variables,gnuplot,curve-fitting,data-fitting,function-fitting
Initial Question (Partially Answered) I am using gnuplot's fitting routines to fit a function to some data, and extract a "characteristic decay time constant". (I call this parameter d in my fitting function.) I have used the script code set fit quiet to prevent reams of text being printed to...

How to plot histograms from rows in data file gnuplot


gnuplot,histogram
t.dat file looks like this: 260.37 260.04 261.53 261.32 260.19 260.49 260.43 260.59 260.26 260.68 260.28 259.93 260.82 259.50 260.29 260.52 260.30 259.91 262.24 260.58 260.74 260.22 261.66 260.31 260.99 259.79 260.90 259.88 260.19 261.50 259.32 260.79 259.94 260.35 260.03 260.07 261.86 261.09 260.60 260.15 75.17 75.16 75.33 75.31 75.34...

How to draw a histogram with broken x-axis and string labels?


gnuplot,histogram
I am trying to draw a histogram with broken x-axis. I learnt the basic solution from this post. However, the x-axis of my histogram is based on strings, not number. It's like this: set terminal pdf set output "test-bar.pdf" set boxwidth 1.0 absolute set style fill solid 1 border 0...

Can I set a default Y range in gnuplot?


gnuplot
My graphs will be generated based on runtime data, such as user-provided time ranges. I can't know ahead of time whether data within the requested xrange will actually exist. In the case that it's not, I'd like to show a blank plot (with X=time range as requested, but arbitrary Y...

Plotting the inverse of the numbers in columns in gnuplot with for loop


for-loop,gnuplot
I want to plot the inverse of the numbers in a number of columns against the first column: plot for [i=1:30] 'file' using 1:(1/i) w lp which results in all the y values to be zero. It works when I remove the for loop and just pick a column to...

Is it possible to “print” gnuplot's output directly to STDOUT?


c++,gnuplot
I am using a third-parter utility named gnuplot-iostream to invoke gnuplot from C++ in the back-end of a web application. That web application is executed under CGI, so anything that goes to STDOUT is the result to browser. In this case, the web request will be for the image itself,...

GNUPLOT: Joining different series of points with vectors


function,vector,gnuplot,points
I have a file with data in 2 columns X and Y. There are some blocks and they are separated by a blank line. I want to join the points (given by their coordenates x and y in the file) in each block using vectors. I'm trying to use these...

Gnuplot, normalize over x axis


gnuplot
I've got two datasets referring to the same process executed in two different ways. The execution A is slower than the execution B with respect to real time, but the two graphs represent the same phenomena.. I can plot the two together as follows: plot 'A' using 1:2, 'B' using...

Set label on group multiplot in gnuplot


linux,graph,plot,gnuplot
Im plotting one picture with 4 different graphs using gnuplot. Labels for their x and y axes have the same meaning. If Im plotting it like this: set multiplot layout 2,2 rowsfirst set xlabel "x" set ylabel "y" set title offset -3,-3 set xrange [20:70] set yrange [0:15000] set title...

gnuplot - How can I count the number of entries in a csv file column?


csv,plot,gnuplot,function-fitting
I have a gnuplot code which includes a function fitting routine. This routine is slow when a large number of data points must be fitted. The number of data points in my input file is variable depending on the parameters of some simulations I am running. I wish to fit...

Counting number of plotted points in gnuplot


gnuplot
The data file contains values in the following format: 0 0 50 0 1 70 1 0 40 1 1 70 2 0 110 2 1 60 3 0 60 3 1 120 4 0 50 4 1 50 5 0 70 5 1 70 This is a code snippet...

plotting points in 3d surface using x,y,z coordinates


3d,gnuplot
I need to plot some points in 3d surface based on x,y,z coordiantes values in a file named as test.dat test.dat file contains At-No X Y Z 6 3.532210 -2.171743 0.921140 7 1.164869 -1.418981 0.782133 1 2.454732 2.332989 -0.907213 6 -3.246376 -1.047325 -0.602590 6 -2.620684 0.053348 -0.013310 6 -4.569969 -1.249720...

Can I have multiple colors in a gnuplot label?


label,gnuplot
I have this graph in gnuplot: I want to include totals for each of the three colored line graphs. One possibility is to replace the key with this: Can I plot this with a single label that switches colors? If not then I'd have to use six labels. In that...

Whether is it possible to plot normal probability distribution in gnuplot


linux,shell,plot,gnuplot
My data file is as- 2 3 4 1 5 2 0 3 4 5 3 2 0 3 4 0 5 4 3 2 3 4 4 0 5 3 2 3 4 5 1 3 4 My requirement is to plot normal PDF in gnuplot. I could do...

C++ Pass a string into a pipe to gnuplot


c++,string,pipe,gnuplot
I'm having a small problem passing a string to gnuplot from c++ I can pass integers easily enough, but when I try a string (user defined as "title" earlier in the code): fprintf(gnuplotPipe, "set title %s\n", title); I get the error: error: cannot pass objects of non-trivially-copyable type ‘std::string {aka...

Gnuplot bar chart from this CSV input


bash,gnuplot
I have csv file data.dat for example with these values: #W=1 0;sqlite;11500 1;hsql;14550 2;h2;17550 #W=2 0;sqlite;11000 1;hsql;13800 2;h2;16500 #W=3 0;sqlite;11000 1;hsql;13800 2;h2;16500 #W=4 0;sqlite;11000 1;hsql;13800 2;h2;16500 I need to plot bar charts into pdf. each data for each graph starts with title #W1,#W2.... i have tried this script: cat <<...

Creating a hexplot


r,matlab,matplotlib,gnuplot,matlab-figure
I am trying to create a figure like the one depicted in the third column of the following image: Link for the image in case of backup. Basically I have x and y positions of 200 particles and I have the MSD data for these 200 positions. I'd like MSD...