0

Current Plots - need to combine them

My data looks like 0.9000000000000000 -0.572163 -118.847449 -28.339693 -57.091368 -28.256491 0.9010000000000000 -0.574697 -119.339844 -28.271377 -57.478850 -28.158812 0.9020000000000000 -0.581214 -119.884476 -28.207152 -58.066133 -28.084056 0.9030000000000000 -0.576983 -120.334988 -28.125961 -58.626419 -28.007351 0.9040000000000000 -0.585352 -120.814916 -28.030456 -59.158599 -27.913946 0.9050000000000000 -0.582894 -121.399251 -27.945236 -59.732370 -27.832271 0.9060000000000000 -0.588467 -121.874480 -27.879678 -60.276944 -27.746891 0.9070000000000000 -0.587192 -122.408344 -27.783382 -60.778178 -27.665076 0.9080000000000000 -0.592806 -122.988079 -27.696940 -61.382354 -27.568282

I am able to graph the data how i want; however i cannot seem to get the X-Axis to cooperate. The script is shown below...

set xlabel "Frequency" set ylabel "S21 - dB" set y2label "S11 - dB" set y2range [-50:0] set yrange [-100:0] set ytics 10 set y2tics 5 set grid set xtics rotate

plot "gnu.dat" every ::15 using 2:xtic((int($0) % 5)==0?stringcolumn(1):"") with lines axes x2y2, \ '' every ::15 using 4 with lines axes x1y1

When i go to plot "...2:xtic..." it only allows for 1 parameter to be fed into the xtic function. Is there any way to pass 2 arguments into the "xtic" function? i have made multiple attempts to xtic(blah blah) and i have tried to cascade them xtic(blah):xtic(blah), but it sends an error or only displays the last arugment passed.

From the image attached i want to be able to combine the X-axis from both images into one. Is this possible?

Any help would be greatly appreciated

2 Answers 2

0

I do not understand your comment about 2 arguments to xtic(). Also it is not clear whether you are expecting the x coordinate to be generated from column 1 (in which case you need to add that to the using specifier) or from the line number (column 0). But the answer to generating both regularly spaced tics and data-dependent tics is to use the "add" keyword:

set xtics add .1         # regularly spaced tic mark every 0.1
plot ... using 1:2:xticlabel((int($0) % 5)==0?stringcolumn(1):"")
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for answering, To clarify i want the x-coordinate to stem from column 0, so from the data above x coordinate is far left, while i base my y-axis coordinates from any column i choose on the right 0.9030000000000000 -0.576983 -120.334988 -28.125961 -58.626419 -28.007351
0

I am terribly sorry for asking this question poorly, I was able to achieve exactly what i desired by using

stats "file" every using 1 set xrange[STATS_min:STATS_max]

I also used Ethans "ADD" function to help with the rest of the script.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.