I want to show how used space changes on my disk by drawing a figure with x-axis the sampling time point and y-axis storage used on disk.
However, currently, the storage used is recorded in bytes, which is not human-readable when value goes beyond GB.
So, could I re-tic axis in gnuplot? In my case, could I change the value 100000000, for example, into 100MB?
Thanks and Best Regards.
You have two main options. The first (and probably easiest) is to scale things when you plot:
plot 'datafile' using 1:($2/1e6) title 'Usage in MB'
This will plot the second data column in the file datafile with each value divided by 1e6, versus time (first column).
You can also re-tic the axes, but this is a bit less general.
set ytics ("100" 1e8)
Another option would be to use scientific notation on the y axis (as I have been doing with these big numbers above). To do that, the command is
set format y '%.2e'
This will print the y tics using scientific notation with 2 figures after the decimal point. You could also try
set format y '%.2g'
which will print the more compact of either scientific or normal notation.
Related
When I do a scatter plot, by default it shows the axis from 0.0 to 1.0 fractions.
For example, the following graph contains a straight line that goes from (0,0) to (10m,10m), but it shows:
Detailed data generation show at: Large plot: ~20 million samples, gigabytes of data
How to make the axes show from 0 to 10 million instead?
The inspiration for this comes from this question.
Tested in VisIt 2.13.3.
Since scatter plot associates variables of potentially radically different scales, by default, it maps each variable's range into [0,1]. We have this ticket for it. You can manually change by going to scatter plot attribute's window and Apperance tab and un-checking the 'Normalize the axes to a cube' option
I have a matrix of data, which is an output of automatic music transcription program. I want to plot it using gnuplot, assigning appropriate labels. Here's my dropbox with some data, where Intensity.dat is actual data, example.stn is a column of string values, some of which are to be displayed on y axis and example.all is just a result of paste example.stn Intensity.dat > example.all Script:
reset
set title "Intensity detection"
set palette negative grayscale
set cbrange [0.01:1]
set xlabel "Time [s]"
set ylabel "Musical note"
set terminal qt font "Verdana,16"
set logscale cb
xincr=0.04644
yincr=1
plot 'example.all' u (($1+0.5)*xincr):($2*yincr):3 matrix with image
produces
plot produced by script 1. Everything's OK, now just tic labels...
After I change the last line to plot 'example.all' u (($1+0.5)*xincr):($2*yincr):3 matrix rowheaders with image, the y-axis becomes too densly populated (It's plot2.jpg from my dropbox, link on top. Sorry guys, I'm new and it doesn't allow me to post more than 2 links).
What I want is a way to present only the labels I want (or hide others, whatever), not all at a time (because it looks unreadable). I'd also like to be able to quickly change them to the others when I need to do so. Supposingly, I want to display every 12th label, but still keep entire matrix with all rows plotted. Or every 12th starting from 2nd label AND every 12th starting from 6th. I've already tried many ways but I'm stuck. Functions like :ytics() or :yticlabels() can't make it, at least for me. And yes, I need this Verdana 16, and removing labels completely is out of question.
I'll be extra grateful if the method applies also for x-axis, as I have an analogical problem with x-axis in other plot, but I generally appreciate any help.
You can separate plotting the image from plotting the ytics like this:
condition(n) = (ceil(n)%12-2 == 0) || (ceil(n)%12-6 == 0)
plot 'Intensity.dat' u (($1+0.5)*xincr):($2*yincr):3 matrix with image ,\
'example.stn' u (NaN):0:ytic(condition($0) ? strcol(1) : "") notitle
The function condition checks whether the label should be plotted or not. I have used ceil to convert from a real number to an integer which is required by the modulo operator (%). The condition function is called with the linenumber $0. The NaN while plotting 'example.stn' avoids plotting data points while keeping the chance for setting the labels. If the condition is met (12th label starting from 2nd or 12th starting from 6th), we use the actual label, else an empty string is used.
I have a data file of two column, ten row ‘blocks’, with two lines of whitespace between each block. Each frame of the animation I want the ten points in the successive block to be plotted, until the end of the data file.
I've searched for how to do this for ages but can't appropriate any of the examples I've found to my case as I don't understand the syntax and can't find an explanation of it anywhere.
How would the example here or here be extended to blocks of x rows?
E.g., in the second example, pasted below for easy reference
n=10 # n present here the number of blocks in your file
plot "output.dat" using 1:2 every :::i::i
i=i+1
if i<n reread
What do the number of colons in every :::i::i mean? Is that three data lines, then two whitespace lines? (Appropriating assuming that doesn't work.)
(If this question seems too obvious, I assure you it is due to my lack of knowledge, not my lack of effort in researching. I would very gladly accept being pointed towards the place in the documentation where this is covered.)
This is not an answer regarding the syntax of every, but a way to achieve this animated plot that is scalable for future users in my position.
A datablock, or block, is x consecutive lines of data, separated by exactly two lines of whitespace.
The plot command option index can be used to access each of these blocks.
For example, plot "datafile.dat" using 1:2 index 1 would plot only the points in the first dataset (block of data).
A loop can be used to animate your data. The stats command can be used to find the number of datasets/blocks in your file, to use in the loop.
set terminal x11
stats 'bdata.txt' nooutput
set xrange [0:10]
set yrange [0:10]
do for [a = 1: int(STATS_blocks - 1)] {
plot "bdata.txt" using 1:2 index a
pause 0.1
}
I've written a program which reads measurements from an impedance analyzer as it sweeps over a range of frequencies or voltages, saves the data to a text file, and also creates a scatter plot. In one type of measurement, I obtain x and y values for complex impedance, neither of which are the independent parameter. Now when plotting this graph, it appears that it simply puts each x value to the right of the previous one at regular spacings resulting in x axis labels looking like, from left to right, [45000, 43000, 40000,... etc.].
I've tried forcing the x-axis to start from zero which did not change anything and haven't been able to find much else on this. Is there a way to make sure the plot reflects the actual x values of each point?
Here's my current method of creating the chart,which pulls the data from the already created table:
For Each row In table.Rows
Chart1.Series("series1").Points.AddXY(row(0), row(1))
Next
I have a pptx file with a single shape. Setting it to 70% transaprent I can compare the pptx and see the only difference is in /ppt/slides/slide1.xml
<a:solidFill>
<a:schemeClr val="accent1">
<a:alpha val="40000"/>
</a:schemeClr>
</a:solidFill>
Anyone have any idea how on earth "70%" translates to "40000"?
It seems different for me. My alpha values seem to use this function:
y = -1000x + 100000
Where x is the percentage and y is the alpha value. I recommend you do the same (figure out a function based on your computer and verify them) and not worry about it.
It seems each single percentage unit corresponds to 1000 of these alpha units.