2017-11-01 2 views
0

여러 세트의 데이터를 다른 플롯에 플롯하려하고 각 플롯에서 일부 마커를 나타 내기 위해 수직선을 그리려하고 있습니다. 문제는 이러한 마커 선을 정렬하는 것입니다. 모든 플롯의 경우 x 축은 0부터 각 플롯의 다른 최대 값으로 시작합니다.x 축을 멀티 플롯으로 동기화

아래 스크립트를 컴파일하면 내 문제의 예제가됩니다. 각 플롯의 왼쪽에는 동일한 x 좌표에서 시작하는 파란 점선 두 개가 있고 내 마음은 수직으로 정렬되어야합니다. 왼쪽의 검은 색 선은 최대 값이 다르기 때문에 필요 없습니다. 질문은 : 파란 점선이 왜 정렬되지 않으며 어떻게 정렬시킬 수 있습니까?

7.500000000 7.5000000000000 
7.500000000 7.5000000000000 
9.452500000 9.4525000000000 
9.452500000 9.4525000000000 
9.452500000 9.4525000000000 
11.583156599 11.405000000000 
11.539727382 11.405000000000 
13.596201524 13.357500000000 
13.536332124 13.357500000000 
13.536332124 13.357500000000 
15.716136896 15.310000000000 
15.609405439 15.310000000000 
17.730589548 17.262500000000 
17.577538550 17.262500000000 
17.577538550 17.262500000000 
19.942432455 19.215000000000 
19.696399454 19.215000000000 
21.853782286 21.130916000000 
21.613241577 20.806748000000 
21.613241577 20.806748000000 
23.951367855 23.371000000000 
23.675253265 22.897216000000 
25.876028840 25.286916000000 
25.652539079 24.962748000000 
25.652539079 24.962748000000 
27.981455855 27.527000000000 
27.700588520 27.053216000000 
29.901766287 29.442916000000 
29.673917026 29.118748000000 
29.673917026 29.118748000000 
32.015564739 31.683000000000 
31.728849366 31.209216000000 
33.935280551 33.598916000000 
33.711807047 33.274748000000 
33.711807047 33.274748000000 
36.043972335 35.839000000000 
35.760577517 35.365216000000 
37.962737205 37.754916000000 
37.735787279 37.430748000000 
37.735787279 37.430748000000 
40.076026405 39.995000000000 
39.789136095 39.521216000000 
41.995165304 41.910916000000 
41.771451945 41.586748000000 
41.771451945 41.586748000000 
44.104011430 44.151000000000 
43.820512338 43.677216000000 
46.022759682 46.066916000000 
45.795460028 45.742748000000 
45.795460028 45.742748000000 
48.136073388 48.307000000000 
47.849254547 47.833216000000 
50.056153041 50.222916000000 
49.831177787 49.898748000000 
49.831177787 49.898748000000 
52.166378677 52.463000000000 
51.883485575 51.989216000000 
54.072515581 54.378916000000 
53.849825503 54.054748000000 
53.849825503 54.054748000000 
56.210825315 56.619000000000 
55.904445477 56.145216000000 
58.071242482 58.571500000000 
57.894686723 58.571500000000 
57.894686723 58.571500000000 
60.260074125 60.524000000000 
60.099923105 60.524000000000 
62.215148559 62.476500000000 
62.119379597 62.476500000000 
62.119379597 62.476500000000 
64.312509506 64.429000000000 
64.237663656 64.429000000000 
66.335699265 66.381500000000 
66.265901323 66.381500000000 
66.265901323 66.381500000000 
68.348020041 68.334000000000 
68.359113309 68.334000000000 
70.495709175 70.286500000000 
70.423033245 70.286500000000 
70.423033245 70.286500000000 
72.195364598 72.239000000000 
72.542252421 72.239000000000 

을 그리고 7pto.dat 파일은 다음과 같습니다 :

7.500000000 7.5000000000000 
7.500000000 7.5000000000000 
9.452500000 9.4525000000000 
9.452500000 9.4525000000000 
9.452500000 9.4525000000000 
11.570027646 11.405000000000 
11.528708226 11.405000000000 
13.575782705 13.357500000000 
13.513624522 13.357500000000 
13.513624522 13.357500000000 
15.677771574 15.310000000000 
15.586498468 15.310000000000 
17.700850877 17.262500000000 
17.547059322 17.262500000000 
17.547059322 17.262500000000 
19.888641959 19.215000000000 
19.678988604 19.215000000000 
21.803504020 21.130916000000 
21.596035886 20.806748000000 
21.596035886 20.806748000000 
23.873441618 23.371000000000 
23.640802845 22.897216000000 
25.807281382 25.286916000000 
25.618453971 24.962748000000 
25.618453971 24.962748000000 
27.871056796 27.527000000000 
27.641136558 27.053216000000 
29.799548044 29.442916000000 
29.605761869 29.118748000000 
29.605761869 29.118748000000 
31.867722758 31.683000000000 
31.637509864 31.209216000000 
33.793129515 33.598916000000 
33.592025117 33.274748000000 
33.592025117 33.274748000000 
35.870634350 35.839000000000 
35.636214996 35.365216000000 
37.804791496 37.754916000000 
37.605887777 37.430748000000 
37.605887777 37.430748000000 
39.885438407 39.995000000000 
39.649447834 39.521216000000 
41.818678704 41.910916000000 
41.616398208 41.586748000000 
41.616398208 41.586748000000 
43.903726004 44.151000000000 
43.665404575 43.677216000000 
45.824542985 46.066916000000 
45.630606451 45.742748000000 
45.630606451 45.742748000000 
47.935779735 48.307000000000 
47.672861008 47.833216000000 
49.824715050 50.259500000000 
49.673951259 50.259500000000 
49.673951259 50.259500000000 
51.987893623 52.212000000000 
51.855902368 52.212000000000 
53.965761583 54.164500000000 
53.884656301 54.164500000000 
53.884656301 54.164500000000 
56.057317126 56.117000000000 
55.987281835 56.117000000000 
58.080894317 58.069500000000 
58.010422067 58.069500000000 
58.010422067 58.069500000000 
60.105273987 60.022000000000 
60.105270232 60.022000000000 
62.246754237 61.974500000000 
62.167660596 61.974500000000 
62.167660596 61.974500000000 
63.942897335 63.927000000000 
64.295080389 63.927000000000 

내가 데이터를 연결하는 방법을 잘 모르겠습니다 그래서 죄송 파일을 다음과 같이

mpl_top = 0.2 #inch outer top margin, title goes here 
mpl_bot = 0.6 #inch outer bottom margin, x label goes here 
mpl_left = 1.3 #inch outer left margin, y label goes here 
mpl_right = 0.2 #inch outer right margin, y2 label goes here 
mpl_height = 3.0 #inch height of individual plots 
mpl_width = 4.5 #inch width of individual plots 
mpl_dx  = 0.1 #inch inter-plot horizontal spacing 
mpl_dy  = 0.5 #inch inter-plot vertical spacing 
mpl_ny  = 2 #number of rows 
mpl_nx  = 1 #number of columns 

# calculate full dimensions 
xsize = mpl_left+mpl_right+(mpl_width*mpl_nx)+(mpl_nx-1)*mpl_dx 
ysize = mpl_top+mpl_bot+(mpl_ny*mpl_height)+(mpl_ny-1)*mpl_dy 

# placement functions 
# rows are numbered from bottom to top 
bot(n) = (mpl_bot+(n-1)*mpl_height+(n-1)*mpl_dy)/ysize 
top(n) = 1-((mpl_top+(mpl_ny-n)*(mpl_height+mpl_dy))/ysize) 
# columns are numbered from left to right 
left(n) = (mpl_left+(n-1)*mpl_width+(n-1)*mpl_dx)/xsize 
right(n) = 1-((mpl_right+(mpl_nx-n)*(mpl_width+mpl_dx))/xsize) 

set terminal postscript eps enhanced color dl 2.0 size xsize,ysize "Helvetica" 28 
set encoding iso_8859_1 
set tics scale 1.5 

set output 'test.eps' 
# 
set offsets 
set autoscale fix 
set size 1,1 
set nokey 
# 
set multiplot 
# 
set lmargin at screen left(1) 
set rmargin at screen right(1) 
# 
set tmargin at screen top(2) 
set bmargin at screen bot(2) 
#..................................................... 
#..................................................... 
# 
set origin 0.0,0.0 
set xrange [0.0:79.739] 
set yrange [-1.1:1.1] 
set format x 
set ylabel "z-z_0 ({\305})" font ",36" 
set format y "%-2.2f" 
set ytics 
set mytics 
# 
set arrow 19 from first 7.5, first 0 to first 72.239, first 0 nohead dt 2 lw 2 lc 0 
set arrow 29 from first 7.5, graph 0 to first 7.5, graph 1 nohead dt 2 lw 2 lc rgb "blue" 
set arrow 39 from first 72.239, graph 0 to first 72.239, graph 1 nohead dt 2 lw 2 lc 0 
set arrow 49 from first 19.215, graph 0 to first 19.215, graph 1 nohead dt 2 lw 2 lc rgb "blue" 
set arrow 59 from first 58.5715, graph 0 to first 58.5715, graph 1 nohead dt 2 lw 2 lc 0 
# 
plot '9pto.dat' u 1:(column(1)-column(2)) w p pt 7 ps 1 lc rgb "red" 
#----------------------------------------------- 
# 
#========================9pto================================ 
# 
unset arrow 19 
unset arrow 29 
unset arrow 39 
unset arrow 49 
unset arrow 59 
# 
#========================7pto================================ 
# 
#----------------------------------------------- 
set lmargin at screen left(1) 
set rmargin at screen right(1) 
# 
set tmargin at screen top(1) 
set bmargin at screen bot(1) 
#..................................................... 
unset xrange 
unset yrange 
unset y2range 
unset ylabel 
unset y2label 
unset ytics 
unset y2tics 
unset my2tics 
#..................................................... 
# 
set origin 0.0,0.0 
set xrange [0.0:71.427] 
set yrange [-1.1:1.1] 
set format x 
set ylabel "z-z_0 ({\305})" font ",36" 
set format y "%-2.2f" 
set ytics 
set mytics 
# 
set arrow 17 from first 7.5, first 0 to first 63.927, first 0 nohead dt 2 lw 2 lc 0 
set arrow 27 from first 7.5, graph 0 to first 7.5, graph 1 nohead dt 2 lw 2 lc rgb "blue" 
set arrow 37 from first 63.927, graph 0 to first 63.927, graph 1 nohead dt 2 lw 2 lc 0 
set arrow 47 from first 19.215, graph 0 to first 19.215, graph 1 nohead dt 2 lw 2 lc rgb "blue" 
set arrow 57 from first 50.2595, graph 0 to first 50.2595, graph 1 nohead dt 2 lw 2 lc 0 
# 
plot '7pto.dat' u 1:(column(1)-column(2)) w p pt 7 ps 1 lc rgb "red" 
#----------------------------------------------- 
# 
#========================7pto================================ 
# 
unset multiplot 

9pto.dat입니다 이 메시지의 길이까지

답변

1

다시 생각해보십시오. 파란색 선은 같은 x 위치에 from first 7.5, from first 19.215으로 표시됩니다. 좌표계 first은 x 축과 y 축으로 정의됩니다. 당신은 다른 x 축을가집니다. 따라서 파란색 선이 정렬되어야하는 실제 이유가 없습니다. first를 유지 또는 screen

  • 시스템을 조정하고를 사용

    • 는이 x 축에 의존하지 않는 좌표계를 사용

      은 몇 가지 가능성이있다, 선을 정렬하려면 어디서나 같은 x 범위 (나는 이것이 바람직한 해결책이 될 수 있다고 생각한다.)

    • first 좌표계와 th e 다른 x 범위와 라인이 정렬되도록 각 플롯의 x 위치를 다시 계산

  • +0

    저는 '첫 번째'좌표계가 x 축 값을 사용하고 모든 x 축이 0부터 시작했기 때문에 적어도 시작은 동일해야합니다. 나는 이제 이것을 불가능하게하는 종횡비에 관한 문제가 있다는 것을 깨닫는다. 나는'graph' 또는'screen' 좌표계를 사용하여 선의 정확한 위치를 정하는 방법을 모른다. – lucian