Re: [問題] 關於PSTricks
GeoGebra 這個匯出功能似乎不是那麼完善(印象中連 eps 檔都會和原圖差滿多的
PSTricks 我想應該就只是做一個很簡單的程式碼轉換而已
所以出錯也不是很讓人意外
這裡主要的錯誤應該是 \psplot 那兩行的 ld() 這個函數 PSTricks 並不存在
我把它改成 ln() 就可以跑出曲線了
不過 1.0000000000000004 這一行還是執行錯誤
似乎是因為這樣的範圍讓繪圖結果超過畫面太多的緣故
把那一串零去掉幾個就行了
建議如果真的要在 LaTeX 畫這種圖的話可以直接用 PGFPlots
減少這種轉換上的麻煩~
※ 引述《LeonYo (僕は美味しいです)》之銘言:
: 我用GeoGebra匯出PSTricks檔, 想在latex上畫圖,
: 輸出了兩個, 一個能正常顯示, 另一個曲線卻無法顯示,
: 來請教一下到底出了什麼問題?
: 而且正常的改了一些像坐標的參數後, 竟然也無法輸出, 真是怪哉orz
: 以下是可以輸出的PSTricks
: \pagestyle{empty}
: \newrgbcolor{qqwuqq}{0. 0.4 0.}
: \newrgbcolor{ccqqqq}{0.8 0. 0.}
: \psset{xunit=.75cm,yunit=.75cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt
: 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
: \begin{pspicture*}(-0.49457247328791076,-1.5029225537715332)(5.501456041122476,2.4944297891687195)
: \psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt
: 0,subticks=2]{->}(0,0)(-0.49457247328791076,-1.5029225537715332)(5.501456041122476,2.4944297891687195)
: \psplot{-0.49457247328791076}{5.501456041122476}{(-0.--1.*x)/1.}
: \psplot[linewidth=1.2pt,linecolor=qqwuqq,plotpoints=200]{1.0000035902425313}{5.501456041122476}{ln(x-1.0)/ln(2.0)}
: \psplot[linewidth=1.2pt,linecolor=ccqqqq,plotpoints=200]{3.942694715705307E-6}{5.501456041122476}{ln(x)/ln(2.0)}
: \begin{scriptsize}
: \rput[bl](-4.438979752083265,-4.613445072284644){$f$}
: \rput[bl](1.1599607812403419,-4.613445072284644){\qqwuqq{$g$}}
: \rput[bl](0.16724082852339028,-4.613445072284644){\ccqqqq{$h$}}
: \psdots[dotsize=4pt 0,dotstyle=*](2.,1.)
: \psdots[dotsize=4pt 0,dotstyle=*](1.,0.)
: \psdots[dotsize=4pt 0,dotstyle=*](0.5,-1.)
: \psdots[dotsize=4pt 0,dotstyle=*](4.,2.)
: \psdots[dotsize=4pt 0,dotstyle=*](1.5,-1.)
: \psdots[dotsize=4pt 0,dotstyle=*](2.,0.)
: \psdots[dotsize=4pt 0,dotstyle=*](3.,1.)
: \psdots[dotsize=4pt 0,dotstyle=*](5.,2.)
: \end{scriptsize}
: \end{pspicture*}
: 以下是無法顯示曲線的:
: \pagestyle{empty}
: \psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt
: 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
: \begin{pspicture*}(-0.5,-1.)(5.5,2.5)
: \psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt
: 0,subticks=2]{->}(0,0)(-0.5,-1.)(5.5,2.5)
: \psplot{-0.5}{5.5}{(-0.--1.*x)/1.}
: \psplot[linewidth=1.2pt,linecolor=red,plotpoints=200]{1.0000000000000004}{5.5}{ld(x-1.0)}
: \psplot[linewidth=1.2pt,linestyle=dashed,dash=1pt
: 1pt,plotpoints=200]{3.999999999977212E-6}{5.5}{ld(x)}
: \begin{scriptsize}
: \rput[bl](-5.184960774378413,-5.376394038404407){$f$}
: \rput[bl](1.1610284276553742,-5.376394038404407){\red{$g$}}
: \rput[bl](0.15461604319186611,-5.376394038404407){$h$}
: \psdots[dotsize=4pt 0,dotstyle=*](1.,0.)
: \psdots[dotsize=4pt 0,dotstyle=*](2.,0.)
: \psdots[dotsize=4pt 0,dotstyle=*](2.,1.)
: \psdots[dotsize=4pt 0,dotstyle=*](3.,1.)
: \psdots[dotsize=4pt 0,dotstyle=*](4.,2.)
: \psdots[dotsize=4pt 0,dotstyle=*](5.,2.)
: \end{scriptsize}
: \end{pspicture*}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.243.1
※ 文章網址: https://www.ptt.cc/bbs/LaTeX/M.1471371926.A.CC7.html
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):