2013-04-26 40 views
0

我剛通過釀造在我的MAC,並且當我繪製的數據或不顯示軸的功能(雖然它顯示該圖表)安裝的gnuplot和pngcairo。pngcairo不顯示軸的Gnuplot

如果我改變終端PNG或SVG或其他任何東西,它完美的作品,但一旦我把我的終端再次pngcairo它側重於圖形。

任何想法來解決這個問題? (此圖和數據來自gnuplotting.org)

#!/usr/bin/gnuplot 
# 
# Creates a version of a plot, which looks nice for inclusion on web pages 
# 
# AUTHOR: Hagen Wierstorf 


reset 

# png 
#set terminal pngcairo 
#set output 'nice_web_plot.png' 

set xtics rotate by 90 offset 0,0 right 
# define axis 
# remove border on top and right and set color to gray 
set style line 11 lc rgb '#808080' lt 1 
set border 3 back ls 11 
set tics nomirror 
# define grid 
set style line 12 lc rgb '#808080' lt 0 lw 1 
set grid back ls 12 

# color definitions 
set style line 1 lc rgb '#8b1a0e' pt 1 ps 1 lt 1 lw 2 # --- red 
set style line 2 lc rgb '#5e9c36' pt 6 ps 1 lt 1 lw 2 # --- green 

set key bottom right 

set xlabel 'x axis label' 
set ylabel 'y axis label' 
set xrange [0:1] 
set yrange [0:1] 

plot 'data.dat' u 1:2 t 'Example line' w lp ls 1, \ 
''     u 1:3 t 'Another example' w lp ls 2 

This plot and data comes from gnuplotting.org

+0

你可以發佈你用來做代碼情節,和gnuplot版本? – andyras 2013-04-26 12:58:14

+0

我編輯的帖子,我使用OS X 10.8.3和gnuplot 4.6.2的信息。 – Anoracx 2013-04-26 13:04:52

回答

0

嘗試,如果這對你的作品:

set xzeroaxis 
set yzeroaxis 
set xtics axis 
set ytics axis 
+0

感謝您的回答,但不,我不會這麼做。 – Anoracx 2013-04-26 14:46:32

+0

@Anoracx另一個想法:也許你的抽動只是不要在軸上顯示,因爲抽動默認距離爲1,你的情節也僅限從0到1.嘗試'設置xtics 0.2' – psibar 2013-04-26 14:52:14

+0

我試過,很好,但它不」不管工作。 – Anoracx 2013-04-26 15:05:09

2

如何來解決這個問題:在

此類型終端

brew rm cairo pango gnuplot 
brew edit pango 

變更網址和SHA256到

url 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.29/pango-1.29.5.tar.xz' 
sha256 '578c38de8450baa61d651e96049d2710f242bda3c47afc2d84773cbafeed775a' 

然後重新安裝的gnuplot

brew install gnuplot --cairo --wx --use-clang 

現在應該工作(該解決方案在這裏找到:https://github.com/mxcl/homebrew/issues/11901