Box plot with 2 variables, changing variables on the x axis - rename

I have a boxplot that looks like this:
My x axis has 2 variables (0 and 1) which I want to rename "Low" and "High" respectively but I just can't seem to find the code for this.
This is the code I used for the boxplot: data$meansplit is the vector on the x axis I want to rename
boxplot(data$threshold_SDT ~ data$meansplit)

Related

How to hold the value of a variable in excel bar graph?

I have a plot in excel bar graph as shown in the image. But I want the Y axis data to be held at it's value until the next discrete sample in X axis .i.e the value of Y axis is 160.8 at X=1, and I want this value to be held until X=2 where the value of Y changes to 2. How do I do this?
Edit 1 - I tried following this tutorial and it worked - https://trumpexcel.com/step-chart-in-excel/
But I had to format the X axis cells to date format. I want the same to work when X axis format is a number.

Gnuplot: Axis format

I have a question about the format of the axis in gnuplot.
I am obtaining a plot that looks like this
.
But I want the axis formats to match, I have so far used
"set format x '%.0t*10^{%.0S}'"
to obtain
.
The question is if there is any way of changing the * to a x so the y and x axis match. I have read that {/Symbol \264} should produce a x for me, but this does not seem to work on my system as it produces some other symbol.

Rotating a plot in gnuplot

1-How can I rotate my plot so y would be the new x axis and vice versa?
2- Change the maximum value of y axis from 60 to 100.
The plot is created by this script in the terminal :
set palette grey
plot 'color_map.dat' matrix with image
You can exchange the x and y axes with the using modifier. (Just like for ordinary plots, except that for matrix data, columns 1 and 2 are not in your data file, but are inferred.)
plot 'color_map.dat' matrix using 2:1:3 with image
If you actually just want to change the maximum value on the y (new x) axis, you would use set xrange[:100]. But it sounds like you might actually want to scale the data itself, in which case you could use
plot 'color_map.dat' matrix using ($2/60.*100):1:3 with image
Try help plot matrix for more details.

How to label vector in gnuplot

I would like to know how to give a label at the end of a vector in gnuplot. I know it is possible to use "set" in gnuplot to show a certain label at some place, but I have hundreds of vectors to draw, and I want to show the index of each vector at its end, e.g., "Node n". Thus I wonder if it is possible to show the labels with incremental index in "one step" with corresponding vectors.
My OS is Ubuntu 13.04 32bit version. Thanks for any advice!
Imagine you have a file with the following data (which I named "temp"), where the first two coordinates are the origin and the last two coordinates are the x and y components (projections) of your vector:
0 0 1 1
0 0 1 2
0 0 1 3
0 0 1 4
0 0 1 5
Then you can do what you want with the following commands:
set xrange [0:1.2]
set yrange [0:6]
plot "temp" with vectors, "temp" u 3:4:0 with labels left
The first instance in plot is to plot the vectors with the same convention I mentioned above in the data file, the second instance is to place a label with coordinates x = column 3 and y = column 4 (that is, at the end of your vectors), with text = column 0 (which gives the order of your data entries) and flush it to the left from those coordinates. It looks like this:

Y-value on bar graph in gnuplot?

Can I get gnuplot to display the exact y-value or height of a data point (plotted using "with boxes") over its bar? I would like the plot to be easy to read so nobody has to line up the top of a bar with the y-axis and guess what the value is.
You can use the labels style and combine it into the plot command with the boxes style. The labels style expects 3 columns of data - the x coordinate, the y coordinate, and the actual label text.
For example, with the following data
1 4
2 6
3 2
4 8
the command (we set the yrange to 0 - 10 and boxwidth to 0.9 and set a solid fill style)
plot datafile u 1:2 with boxes, "" u 1:2:2 with labels offset char 0,1
produces
Normally, the labels would be centered on the specified point (the top edge of the box). By specifying an offset, we can move them up to just above the box. Here we used no offset in the x direction, but a unit of 1 in the y direction. We used the character coordinate system, so this corresponds to moving up by one character unit.
I can only think of putting the values where you want them "manually" like this:
set label "value" at 12,34
The numbers are coordinates according to your x and y ranges.
An automatic way would use "with labels", see e.g.
http://gnuplot.sourceforge.net/demo_4.4/stringvar.html

Resources