2016-02-25 75 views
2

我的X和Y標籤被切斷PICgnuplot的 - 標籤切斷情節

see the plot

我發現作物/ nocrop選項,但沒有奏效。 如何設置保證金?正如你所看到的,這些數據涵蓋了標題(右上角)。我怎樣才能在那裏設置保證金?

以下代碼來自我的bash腳本。

#set output 
set terminal png large size 1920,1080 enhance background rgb '$BKGD_COLOR' 
set output '$PLOT_OUTPUT_DIR/BW_${ArrayFile[$j]}_$DATE.png' 

#set data 
set datafile separator "," 
set timefmt '%d/%m/%Y %H:%M:%S' 
set xdata time 
set format x "%d/%m/%Y\n%H:%M:%S" 

#set axis (new style named 11, disable top and right axis, disable tics on top and right) 
set style line 11 linecolor rgb '$TEXT_COLOR' linetype 1 
set border 3 back linestyle 11 
set tics nomirror font "/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf,16" textcolor rgb "$TEXT_COLOR" 

#set grid 
set style line 12 linecolor rgb '$TEXT_COLOR' linetype 0 linewidth 1 
set grid back ls 12 

#set line style 
set style line 1 lc rgb '$RCVD_COLOR' pt 1 ps 1 lt 1 lw 2 
set style line 2 lc rgb '$SENT_COLOR' pt 6 ps 1 lt 1 lw 2 

#set text 
set key font "/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf,10" textcolor rgb "$TEXT_COLOR"   
set title 'Bandwidth (Mbps)' font "/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf,14" textcolor rgb '$TEXT_COLOR' 
#Removed - set ylabel 'Mbps' textcolor rgb '$TEXT_COLOR' 
set yrange [0:*] 

#plot using the column 1 and 3 of the CSV file. with line points and title 'Bytes Received' and line style 1 (as defined above) 
plot '$DIR/ResultsCSV/mg_bandwidth/${ArrayFile[$j]}.csv' u 1:3 w lp ls 1 t 'Bytes Received', '$DIR/ResultsCSV/mg_bandwidth/${ArrayFile[$j]}.csv' u 1:4 w lp ls 2 t 'Bytes Sent' 

回答

2

在設置終端時設置你的標籤的字體大小。該大小被用於確定自動邊距:

set terminal png ... font ',16' 

或者,也可以設置顯式邊距與

set lmargin screen 0.05 
set bmargin ... 

有關可能的座標類型,例如參見https://stackoverflow.com/a/23180595/2604213

BTW:使用pngcairo終端,它具有更好的渲染質量。

2

@Christoph提供了有關保證金的答案,但您也詢問了您的鑰匙。

爲了解決這個問題,你可以把鑰匙放在不同的位置。做

set key inside top left 

將移動到左側的數據將不會掩蓋它的關鍵。您也可以完全用

set key outside top right 

將其移動到右側,它不會被掩蓋了劇情之外將其ouside的情節。

有關更多詳細信息,請參見help set key

+0

很酷。但是,你知道我是否可以刪除鑰匙中的紅色和綠色線,只保留一個小彩點? –

+0

@CharlyRoch關鍵將會匹配情節的風格。因此,當你使用線點時,鍵也會使用它。你可以使用直線繪製相同的數據兩次,然後再次使用點,抑制第一個繪圖上的按鍵,如'plot datafile w lines notitle,datafile w points title'示例'lt 1'使得只有按鍵出現點。您只需指定線條類型以確保它們使用相同的線條類型。情節看起來與現在一樣,但你只會得到關鍵點。 – Matthew

+0

非常聰明!但是並沒有減少傳說與觀點之間的距離。我的意思是像「legend_____dot」這樣的大空格。謝謝 –