How to change the proportion of the axis in gnuplot? - gnuplot

I have two curves; Curve 1 (x1, y1), Curve 2 (x2, y2) in which the value of x2 is equal z times of the value of x1 (e.g., x2 = 1.5 * x1); y axis value is not change. I would like to plot two curves in the same proportion of the x axis value, i.e. i want to change the proportion of x2 value to the x1 value in order to same the peaks of two curves above.
I had tried to find a lot of supports in internet but it has not any suitable result.
Many thanks for your helps.

Related

Converting plot X, Y to location to draw arrow/line

I have a bunch of data that I'm plotting as point plots. The data is simply a column for X and a column for Y. The catch here though is this is plotted using axes x2y2.
The x1y1 is used for a histogram. The X axis is the same range for both plots.
I know how to derive the X coordinate, but am wondering if there is an easy way to determine the Y value to use to draw an arrow. I want to draw an arrow callout for an arbitrary point on the point plot.
y1 and y2 are independent.
The coordinates for drawing the arrow can refer to different coordinate systems (first, second, character, screen, and graph, see help coordinates).
So, to draw an arrow e.g. from the top-middle of the plot (graph 0.5, graph 1) to x2 = 1, y2 = 2 (second 1, second 2) you would write
set arrow from graph 0.5, graph 1 to second 1, second 2 head

Point of intersection between 4 points

I have 4 points. If I were to draw lines from every point to every other point, I will get 4 exterior lines and 2 lines crossing in the middle. What I'm trying to identify is the point at which the 2 crossing lines intersect. All I know is the coordinates of each of the 4 points (x0, y0, x1, y1, x2, y2, x3, y3).
Is there a simple solution to this that I'm missing?
Edit: Edit: Fixed. I was missing the two formulas: x = x1 + ua (x2 - x1) and
y = y1 + ua (y2 - y1).
There is nothing special in intersection of quadrilateral diagonals. Just use any approach for intersection of two line segments. Wiki (note that perhaps point order differs from yours)

colour contour plot from a sequential xy file (datablocks)

I am trying to produce a colour contour plot (the coloured projection of a surface or a "map") from a file that has the following format:
y1 z1 #first block
y1 z2
y1 z3
....
y1 zn
<blank line>
y2 z1 #second block
y2 z2
y2 z3
....
y2 zn
<blank line>
y3 z1
y3 z2
y3 z3
....
y3 zn
etc
Hence if you took the second column of each datablock, you turned it into a line (instead of column) and you stuck them one on top of the other, you would get your traditional matrix plot.
Is there a way to plot this thing (or to take the z columns, make them into lines, stack them and plot them)?
I have been looking into splot, set view map.
So your xvalues are uniformly distributed? Do something like this
set view map
splot "data" u (column(-1)):($1):($2) w pm3d
If you can define your xvalues, use
xval(x)=1.+0.5*x #or whatever
splot "data" u (xval(column(-1))):($1):($2) w pm3d

Second y axis displaced

I am quite new to gnuplot. And I've got problem with secondary y axis. When I try to plot two curves into one graph with two different y axis, the second one is moved down a little bit. I mean that if you draw a straight line parallel to the x axis at y1 = 0, you get different y2 values. I want both y axes to start at the same point y1=0 ~ y2=0.
Here is the picture better describing my problem:

Find radius and position of circle who's curve bases on two points

I just feel pretty stupid, because I can't find a solution for my problem. Maybe someone can help me please:
I have the values Y1 and X1 (where X1 is always bigger than Y1). If I want to draw a curve between the two points y1, x1 based on a circle (no ellipse), how to find out the y2 value which would be the center of the cycle and the radius (r)? I think the circle's radius would get bigger and it's center would move down on the y-axis the greater x1 is (if Y1 doesn't change), right?
This is simply a math question.
First of all you should find the middle of the two points Y1 (0,10) and X1 (20,0)
which is (10,5).
Now we should determine the slope of the line which is perpendicular on the line between X1 and Y1. That slope is equal to 20/10=2
Thus the equation of that line will become y-5=2*(x-10) and thus y=2x-15
To find the coordinates of Y2 we have to find the point where the x value is 0. that is on y=-15. Thus the Y2 coordinate is (0,-15).
You can find the value for Y2 in the same way for other values than 20 and 10.

Resources