Gnuplot is not ploting anymore - gnuplot

I have a script to plot a graph with gnuplot. Last manth this script was ploting with no errors. I didn't make any modification but now it is not ploting anymore. I did all steps on this web site but still don't work. http://www.gnuplot.info/faq/faq.html#SECTION00092000000000000000
Does anybody have an idea of what is happening?
Thanks!
#!/usr/bin/gnuplot
reset
set grid
set title 'Desempenho do BTRIM com peers de reputação condicionada'
set xlabel 'Tempo'
set ylabel 'Vazão - downloads completos / tempo'
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pi -1 ps 1.0
set style line 2 lc rgb '#dd181f' lt 1 lw 2 pi -1 ps 1.0
set style line 3 lc rgb '#29c524' lt 1 lw 2 pi -1 ps 1.0
set style line 4 lc rgb '#7D72F9' lt 1 lw 2 pi -1 ps 1.0
set style line 5 lc rgb '#000000' lt 1 lw 2 pi -1 ps 1.0
set pointintervalbox 0
plot '<paste ../00/Statistic100.txt ../01/Statistic100.txt ../02/Statistic100.txt ../03/Statistic100.txt ../04/Statistic100.txt ../05/Statistic100.txt ../06/Statistic100.txt ../07/Statistic100.txt ../08/Statistic100.txt ../09/Statistic100.txt' smooth unique with linespoint lt 5 lw 1 title 'Reputação de 100%', \
'<paste ../00/Statistic75.txt ../01/Statistic75.txt ../02/Statistic75.txt ../03/Statistic75.txt ../04/Statistic75.txt ../05/Statistic75.txt ../06/Statistic75.txt ../07/Statistic75.txt ../08/Statistic75.txt ../09/Statistic75.txt' smooth unique with linespoint lt 6 lw 1 title 'Reputação de 75%', \
'<paste ../00/Statistic50.txt ../01/Statistic50.txt ../02/Statistic50.txt ../03/Statistic50.txt ../04/Statistic50.txt ../05/Statistic50.txt ../06/Statistic50.txt ../07/Statistic50.txt ../08/Statistic50.txt ../09/Statistic50.txt' smooth unique with linespoint lt 7 lw 1 title 'Reputação de 50%', \
'<paste ../00/Statistic25.txt ../01/Statistic25.txt ../02/Statistic25.txt ../03/Statistic25.txt ../04/Statistic25.txt ../05/Statistic25.txt ../06/Statistic25.txt ../07/Statistic25.txt ../08/Statistic25.txt ../09/Statistic25.txt' smooth unique with linespoint lt 8 lw 1 title 'Reputação de 25%'
pause -1

Related

How to make "filledcurves" change color when two or more meet? (GNUPlot)

I have created a graph that uses lines for the average of my data and filledcurves for the error (average-error, average+error). My problem is that the last filledcurves that is plotted, covers all other fills, even though I have set its transparency. I want to change this so that when two or more filledcurves meet the color is changed and thus the errors are clearly shown for all lines.
My script is:
set datafile separator whitespace
set style line 1 lc rgb '#aa5500' lt 1 lw 2 pt 7 ps 1
set style line 2 lc rgb '#55aaff' lt 1 lw 2 pt 7 ps 1
set style line 3 lc rgb '#aa557f' lt 1 lw 2 pt 7 ps 1
set style line 4 lc rgb '#55007f' lt 1 lw 2 pt 7 ps 1
set style line 5 lc rgb '#005500' lt 1 lw 2 pt 7 ps 1
set style line 6 lc rgb '#0055ff' lt 1 lw 2 pt 7 ps 1
set tics nomirror
set tics front
set style line 12 lc rgb '#808080' lt 0 lw 1
set grid front ls 12
set output 'network_utilization_servers_3_2.png'
set terminal png size 1000,800
set style fill transparent solid 0.25
set style fill noborder
set xrange[0:77]
set yrange[0:1500]
set xlabel "Time (seconds)" font ",12"
set ylabel "Incoming Traffic (KB/s)" font ",12"
set title "Network Utilization in the Servers" font "Helvetica,16"
set key box title "Server" width 10
plot for [i=0:|Group|-1] $Data3 u ($2-6):($3-$4):($3+$4) index i with filledcurves ls i+1 notitle, \
for [i=0:|Group|-1] $Data3 u ($2-6):3:4 index i w lines ti sprintf("%g",Group[i+1]) ls i+1
and my pragh:
My goal is something like this:
Is there a way to achieve this?

How to draw a circle on a gnuplot figure?

Basically I have a figure below, which is drawn by gnu plot.
The code is listed as follows:
set term pdf size 2.8,1.4 font "Arial,08"
set output "plot/application.pdf"
set datafile separator ","
set offset 0, 0, 0, 0
set size ratio 0.5
set xtics norangelimit
set ytics nomirror
set termoption dashed
set ylabel "Binary Similarity (%)"
set xlabel "Iteration"
set yrange [0:110]
set style data linespoints
set key vertical maxrows 5
set key top right
set key vertical maxrows 5
set style line 2 lt 1 lc rgb "skyblue" lw 1
set style arrow 8 heads size screen 0.008,90 ls 2 lw 10
set arrow from 9.0,0 to 9.0,40 nohead lw 1 as 8
plot 'plot/application.csv' using 1:xtic((int($0)%4)==0?sprintf("%d", $0*10):"") title columnheader(1) pt 1 lw 1, \
'' using 2 title columnheader(2) pt 2 lw 1 ps .1 lc rgb "#4169E1", \
'' using 3 title columnheader(3) pt 3 lw 1 ps .1 lc rgb "#DAA520", \
'' using 4 title columnheader(4) pt 4 lw 1 ps .1 lc 5, \
'' using 5 title columnheader(5) pt 4 lw 1 ps .1 lc 9, \
'' using 6 title columnheader(6) pt 4 lw 1 ps .1 lc 7, \
'' using 7 title columnheader(7) pt 5 lw 1 ps .1 lc 8, \
'' using 7 title columnheader(8) pt 5 lw 1 ps .1 lc 9
I basically want to highlight datas at 90, and that's why I draw a blue arrow line there.. But as you can see, it looks awkward...
So I am thinking to change the blue line into a red circle, something like this:
Does anyone know how to do that? Note that it even has an associated legend of the red circle.. Thank you!
You can always add
'< echo 90 20 10' w circ
to the plot.

I don't have color on my .eps figure using gnuplot

I want to trace some curves with gnuplot. I recently change my computer and now I have a MacOSX 10.9.5
In my other computer, colors appeared in my .eps figure, but with my Mac not anymore, and an error message appears : "· Times not found, using Courier." which is an other problem I think.
My gnuplot version is Version 5.0 patchlevel 0.
Here is my trace.p that I load with gnuplot with
$ gnuplot
gnuplot > load "trace.p"
set autoscale
unset logscale
unset label
set term postscript enhanced 'Times'
set output"E_Hxc_bath_exact_weak.eps"
set title "E^{bath,exact}_{Hxc}/U, E^{bath,weak}_{Hxc}/U functions of U/t with potential more or equal to second-order set to 0"
set xlabel "U/t"
set ylabel "E^{bath}_{Hxc}/U"
set xrange [0.7:10]
set yrange [-7:10]
set key left top
set style line 1 lt 1 lc rgb "red" lw 3
set style line 2 lt 2 lc rgb "red" lw 3
set style line 3 lt 3 lc rgb "red" lw 3
set style line 4 lt 1 lc rgb "green" lw 3
set style line 5 lt 2 lc rgb "green" lw 3
set style line 6 lt 3 lc rgb "green" lw 3
set style line 7 lt 1 lc rgb "black" lw 3
set style line 8 lt 2 lc rgb "black" lw 3
set style line 9 lt 1 lc rgb "blue" lw 3
set style line 10 lt 2 lc rgb "blue" lw 3
set style line 11 lt 3 lc rgb "blue" lw 3
set style line 12 lt 1 lc rgb "violet" lw 3
set style line 13 lt 2 lc rgb "violet" lw 3
plot (0.25 - (3/4)/(sqrt(1+64/(x**2)) + 2*sqrt(1+16/(x**2)))) with lines ls 7 title "exact", (0.25 - 3*(x**2)/64 + (x**3)/(2*16*16)) with lines ls 1 title "weak";
Some lines are certainly useless, but I don't know why the result is colorless, maybe I miss an application or something...
Try adding the color flag to the set term line in your script.
For the dashed lines which didn't appear, it is because in version 5.0, the command change, it is no more linetype but dashtype.
See the response of Gnuplot line types for more precision.

how to define X's label on gnuplot

This is My data :
18_AGT_s 8234.00 8234.00 8234.00
18_MAC_s 8414.36 8308.36 8246.33
9_MAC_r 8414.36 8308.36 8246.33
9_MAC_s 8414.55 8309.55 8246.45
8_MAC_r 8414.55 8309.55 8246.45
8_MAC_s 8414.56 8310.08 8246.47
6_MAC_r 8414.56 8310.08 8246.47
6_MAC_s 8416.19 8310.21 8246.49
1_MAC_r 8416.19 8310.21 8246.49
and here is my gnuplot code :
plot "dat" using ($0+1):2 with linespoints pt 8 ps 2 lt 2 lw 4 lc rgb
"green" title "DMSR","dat" using ($0+1):3 with linespoints pt 5 ps 2
lt 3 lw 4 lc rgb "blue" title "Alarm","dat" using ($0+1):4 with
linespoints pt 6 ps 2 lt 4 lw 4 lc rgb "red" title "Emergency"
and here is my out put :
But In the step part I want to have 18_AGT_s and 18_MAC_s and 9_MAC_s and .... for example on the X part I want to have 18_AGT_s in stand of 1 or I want to have 18_MAC_2 instand of 2 and 9_MAC_r instand of 3 etc. Any help thanks
Use the xticlabels() option with the column number with the labels as argument (1, in this case):
# Optionally rotate labels so they fit
set xtics rotate
plot "dat" using ($0+1):2 with linespoints pt 8 ps 2 lt 2 lw 4 lc rgb \
"green" title "DMSR","dat" using ($0+1):3 with linespoints pt 5 ps 2 \
lt 3 lw 4 lc rgb "blue" title "Alarm","dat" using \
($0+1):4:xticlabels(1) with linespoints pt 6 ps 2 lt 4 lw 4 lc rgb \
"red" title "Emergency"
Here you only need to use it for the last plot instance so that it overwrites the number options.

Set point size independent of line weight

I have the following line styles defined in gnuplot:
set linetype 1 lc rgb "red" lw 3 pt 7
set linetype 3 lc rgb "red" lw 1 pt 7
It appears as though the points derive part of their size from the lineweight. I'm using these styles inside of a plot for loop with linetype cycle using the same style for a cspline and the corresponding points, so I don't see any easy way to just define a separate style for the points.
I get results like this:
The points respond to pointsize but the point in linetype 1 is still slightly larger (presumably from the thicker border).
Is it possible to get the points in these two styles to be the same size?
In response to Miguel's comment, a more complete example of my use case is:
filenames = "A B C D"
set linetype 1 lc rgb "blue" lw 3 pt 7
set linetype 2 lc rgb "red" lw 3 pt 7
set linetype 3 lc rgb "blue" lw 1 pt 7
set linetype 4 lc rgb "red" lw 1 pt 7
set linetype cycle 4
plot for [file in filenames] file.".csv" \
using 1:2
title file \
smooth csplines, \
for [file in filenames] file.".csv" \
u 1:2 with points notitle
linetypes 5-8 get set by the cycling and are used by the last part of the plotting command. Recommendations on another way to do this would be welcome!
For your very specific case you can set more styles, and do it rather automatically with a do for loop (reusing your code):
filenames = "A B C D"
do for [i=0:1] {
set linetype (4*i+1) lc rgb "blue" lw (i == 1 ? 0 : 3) pt 7
set linetype (4*i+2) lc rgb "red" lw (i == 1 ? 0 : 3) pt 7
set linetype (4*i+3) lc rgb "blue" lw (i == 1 ? 0 : 1) pt 7
set linetype (4*i+4) lc rgb "red" lw (i == 1 ? 0 : 1) pt 7
}
set linetype cycle 8
plot for [file in filenames] file.".csv" \
using 1:2 \
title file \
smooth csplines, \
for [file in filenames] file.".csv" \
u 1:2 with points notitle
With some simple data files:
For some terminals the size of filled point types depends on the linewidth because they have a border. This is the case for all cairo-based terminals (pdfcairo, pngcairo, wxt and cairolatex), whereas other terminal like svg, postscript, qt don't show this behaviour.
As test case consider
set linetype 1 lc rgb "red" lw 3 pt 7
set linetype 3 lc rgb "red" lw 1 pt 7
set samples 11
set style function linespoints
plot x lt 1, x + 0.5 lt 3
Considering that you want to have the linepoints samples in the legend, you're best choice is to reduce the point size a bit for the line type with the larger linewidth, like
set linetype 1 lc rgb "red" lw 3 pt 7 ps 0.9
The choice of the scaling factor must be determined manually.

Resources