Setting axis label and histogram labels using GNUplot

Johan Sjolen

I have the following GNUplot file:

set title "Performance of Quicksort over random data sets"
set yrange [0:80000]
set style data histogram
set style histogram cluster
set style fill solid border -1
set boxwidth 0.9
plot for [COL=2:6:1] 'timings.dat' using COL

and the following data file:

# Data-size being x-axis, each data size having a histogram-bar for seq/2-t/4-t/8-t/16-t (color-coded)
# Y-axis is time (the information in the columns below Sequential for example being the timings of sequential program for 2^15...2^28)

Data-size Sequential 2-threaded 4-threaded 8-threaded 16-threaded
2^15      6          4       5     7          10   
2^16      11         9       9     11         19   
2^17      24        17       18        24         32   
2^18      49        35       32        43         59   
2^19      102       71       70        89         115  
2^20      208       145      135       161        201  
2^21      431       295      281       333        416  
2^22      895       598      550       667        870  
2^23      1887      1219     1173      1228       1639 
2^24      3852      2979     2478      2621       3457 
2^25      7962      4980     4693      5064       6834 
2^26      16329     10151    9332      10062      13217
2^27      33775     21039    19072     20008      25196
2^28      69995     43393    38091     40598      52492

And this is what the resulting gnuplot image looks like:

gnuplot

My two issues are:

  1. The x-axis should be labeled according to the data-size column (2^15,...,2^28)

  2. The bars should be named according to their name in the data table (Sequential, 2-threaded, and so on)

I've read through parts of the manual, which got me to this stage, but I'm not experienced enough to understand how what I want can be done unfortunately.

steeldriver

I think what you want is

plot for [COL=2:6:1] 'timings.dat' using COL:xticlabels(1) title columnheader

however you may need to modify the first column powers to 2^{15} and so on in order that they are properly parsed:

$ cat timings.dat 
# Data-size being x-axis, each data size having a histogram-bar for seq/2-t/4-t/8-t/16-t (color-coded)
# Y-axis is time (the information in the columns below Sequential for example being the timings of sequential program for 2^{15}...2^28)

Data-size Sequential 2-threaded 4-threaded 8-threaded 16-threaded
2^{15}      6          4       5     7          10   
2^{16}      11         9       9     11         19   
2^{17}      24        17       18        24         32   
2^{18}      49        35       32        43         59   
2^{19}      102       71       70        89         115  
2^{20}      208       145      135       161        201  
2^{21}      431       295      281       333        416  
2^{22}      895       598      550       667        870  
2^{23}      1887      1219     1173      1228       1639 
2^{24}      3852      2979     2478      2621       3457 
2^{25}      7962      4980     4693      5064       6834 
2^{26}      16329     10151    9332      10062      13217
2^{27}      33775     21039    19072     20008      25196
2^{28}      69995     43393    38091     40598      52492

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

gnuplot : using a logarithmic axis for a histogram

From Dev

Gnuplot: setting custom labels on x2-axis

From Dev

Gnuplot: setting custom labels on x2-axis

From Dev

gnuplot x label position in histogram

From Dev

gnuplot x label position in histogram

From Dev

gnuplot - putting fractions into axis label

From Dev

changing the distance of y axis in histogram GNUPLOT

From Dev

Space between Y axis and bar on gnuplot histogram

From Dev

Changing the x-axis labels of a ggplot histogram

From Dev

Changing the x-axis labels of a ggplot histogram

From Dev

Label the x axis correct in a histogram in R

From Dev

gnuplot Title and Axis labels are cut of by half

From Dev

gnuplot using ``using`` to produce labels

From Dev

Setting all matplotlib axis labels at once

From Dev

Setting the labels on the x-axis of a graph

From Dev

Setting all matplotlib axis labels at once

From Dev

Gnuplot error (label has coord of 0) for histogram with logscale

From Dev

Gnuplot error (label has coord of 0) for histogram with logscale

From Dev

Histogram using gnuplot with multiple y-axes

From Dev

Setting x axis label to bottom in openpyxl

From Dev

Setting Highcharts x axis label's width

From Dev

How to plot two level x-axis labels for a histogram?

From Dev

How can I change y axis label "density" to bold on a histogram?

From Dev

Add y-axis value labels to gnuplot-bar chart

From Dev

Highcharts x axis label text wrapping lost on setting label step

From Dev

Gnuplot: x-axis narrow label spacing in timeseries plot

From Dev

changing the label of x-axis in gnuplot for milliseconds values

From Dev

changing the label of x-axis in gnuplot for milliseconds values

From Dev

Histogram of a label

Related Related

HotTag

Archive