dkogan/feedgnuplot

Log scale?

Closed this issue · 4 comments

Dear Developers and Users,

I have used feedGnulpot for a few days and I was wondering if there is a possibility to set logarithmic scale.
If this is possible to do, please advice.

Cheers,

Eelis

Sure. Commands to gnuplot can be given:

feedgnuplot --extracmds 'set logscale xy'

will send that string as a command to gnuplot prior to sending it any data. The above sets the x and y axes to be base-10 logarithmic. Other options are available, of course. See the gnuplot docs for more info

Great! Thank you very much, I appreciate your fast response.

Cheers,

Eelis

Hi,

Any advice on doing histograms with logarithmic axes? E.g. I am working off the sample code for plotting a histogram of file sizes in a directory, but my files are dominated primarily by a filesize of < 10 MB, with a few in the 10-200 MB range, within this particular folder. So I get a tall box counting many between 0 to 10 MB, but I'd like some more information here. (I could plot separately a histogram of that range, but I think a logarithmic x-axis (file size) scale would do well, as it should give more information about these files while clustering the larger filesizes together more, which is fine).

I tried:
ls -l | awk '{print $5/1e6}' | feedgnuplot --histogram 0 --with boxes --binwidth 10 --set 'style fill solid' --ymin 0 --xlabel 'File size (MB)' --ylabel Frequency --extracmds 'set logscale x' --xmin 1

but this did not work well.

Note that I set --xmin 1 because it gives an error without it:

Warning: empty x range [0:0], adjusting to [-1:1]
         line 73: x range must be greater than 0 for log scale

Please advise.

Thanks,
Daniel

Hi. With a logscale histogram, it's not clear what the binwidth means. If you set it much lower, you might get more pleasing results. Try 0.1