Gnuplot:Logscale似乎搞砸了 [英] Gnuplot: Logscale seems to mess things up
问题描述
我放入一个xlogscale,它弄乱了网格线的图形.主要的x网格线不再是与主要的y网格线相同的灰色,而是次要x和y网格线的灰色.
I put an xlogscale in and it messed up the drawing of the gridlines. The major x gridlines are no longer the same gray as the major y gridlines, they are the gray of the minor x and y gridlines.
以下图片显示了这一点.
The following to pictures show this.
关于如何解决此问题的任何想法?
Any ideas on how this can be fixed?
谢谢
#!/usr/bin/env gnuplot
set term pdfcairo size 15cm,10cm
set output 'FFT.pdf'
set datafile separator ' '
unset key
set border lw 4 back
set grid mxtics mytics xtics ytics lt 1 lc rgb 'gray70', lt 1 lc rgb 'gray90'
set mxtics 5
set mytics 5
set xrange [10:10e3]
set title 'Harmonic Distortion'
set xlabel 'Frequency [Hz]'
set ylabel 'Output Voltage [dB]'
set mxtics 10
set logscale x 10
plot 'FFT.dat' using ($1):(20*log10((($2**2)+($3**2))**0.5)-5.49074) with lines lw 4 lc rgb 'red'
set out
推荐答案
您可以仅使用set mxtics
来解决此问题,而无需指定任何频率:
You can solve this by using only set mxtics
, without specifying any frequency:
set term pdfcairo size 15cm,10cm
set output 'FFT.pdf'
unset key
set samples 1000
set border lw 4 back
set grid xtics ytics mxtics mytics lc rgb 'blue' lt 1, lc rgb 'red' lt 1
set xrange [10:10000]
set mxtics
set mytics 5
set logscale x 10
plot sin(0.001*x) with lines lw 4 lc rgb 'green70'
set out
我为网格线使用了更好的可区分颜色. 4.6.3的结果是:
I used better distinguishable colors for the grid lines. The result with 4.6.3 is:
我不知道,为什么会这样.根据文档set mxtics 10
应该没问题.我将其报告为错误.
I don't know, why this happens. According to the documentation set mxtics 10
should be fine. I will report this as a bug.
这篇关于Gnuplot:Logscale似乎搞砸了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!