linux - gnuplot: xtics not shown on X-axis -


i trying populate graph fixed values on x-axis , corresponding values on y-axis. below script, no values labelled on x-axis , value on y-axis labelled powers.

  1. how make xtics data(1000, 10000, 100000, 1000000, 10000000) appear on x-axis ?
  2. how rid of powers on y-axis ? (example : want 4000000 on y-axis instead of 4x10^6

    set xrange [0:] set output "macs.png" set ylabel "flows/sec" set xlabel  "macs per switch" set grid set xtics (1000, 10000, 100000, 1000000, 10000000) set style line 2 lt 1 lw 2 pt 1 linecolor 1 plot "macs.data" using :1 linespoints linestyle 0 title "floodlight" // using ":1" x-axis data supplied in xtics 

here data file :

# not supplying x-axis data here supplied through xtics 400 60000 700000 800000 900000 

i want populated graph 1 line looks :enter image description here

you have supply x , y value each point. fortunately, gnuplot supports special column numbers column 0, counter of valid data sets, i.e. here line number ignoring comments. starts @ zero.

next, x-axis uses log scale, should it, too. formula convert line number correct x-value 10(colum_0) + 3. translates 10**($0+3) in gnuplot.

here code:

# logarithmic scale x axis set log x   # rid of scientific formatting of numbers, # plain format large numbers set format x "%.0f"  # if don't small ticks between large ones set mxtics 1  # put key (legend) outside, right of plot area,  # vertically centered (as in picture) set key outside right center   # horizontal grid lines set grid y      plot "macs.data" using (10**($0+3)):1 title "foo" linespoints 

and here result:

enter image description here


alternative:

your approach plots data if given like

0   400 1  60000 2 700000 3 800000 4 900000 

in case, need label x-axis on own, correct syntax is

set xtics("1000" 0, "10000" 1, "100000" 2, "1000000" 3, "10000000" 4) 

this not draw automatic labels, put e.g. string 10000 @ x=1


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -