【问题标题】:What does 'Bad format character' means in gnuplot?gnuplot 中的“错误格式字符”是什么意思?
【发布时间】:2019-07-10 08:53:49
【问题描述】:

我是 gnuplot 的新手。我已将以下内容尝试绘制此数据。

# Timepoint Cell Number and Viability
# in 1 x 10^7

1   12175000    76.59
2   30575000    93.60
3   87950000    95.84
4   133650000   97.70
5   231500000   97.68

当我输入没有 y2 轴的数据时,绘制的数据没有任何问题。但是,当我开始放置 y2 轴并在之后将其删除时,gnuplot 停止绘制数据并开始继续出现错误并显示“错误格式字符”消息

我已尝试删除 y2 轴,但 gnuplot 仍不断提示“格式错误”。我也试过删除所有的美学,只是把 plot 'datafile' 命令,但仍然没有运气。请我需要帮助。谢谢。

#Program run for plotting Drosophila cells growth curve

cd 'file location'

set style data linespoints
set title 'Drosophila cells growth curve during induction'

set xrange [0.8:5.2]
set yrange [0:260000000]
set y2range [0:100]
set xlabel 'Hours of culture'
set ylabel 'Cell number'
set y2label 'Percent Viability'
set xtics ('0 hour' 1, '72 hours' 2, '144 hours' 3, '168 hours' 4, '216 hours' 5)
set y2tics ('0%'  0, '10%' 10, '20%' 20, '30%' 30, '40%' 40, '50%' 50, '60%' 60, '70%' 70, '80%' 80, '90%' 90, '100%' 100)

plot 'datafile' using 1:2 lw 3 lc rgb 'black' pt 6 title 'Cell number', 'datafile' using 1:3 lw 3 lc rgb 'red' pt 4 title 'Viability' axis x1y2 

我希望数据用 2 个 y 轴绘制,但我得到的只是第 17 行的加载“数据文件”消息:错误格式字符消息

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    “显式”抽动可以包括使用% 作为特殊字符的格式信息。要从字面上包含它,请将其加倍:

    set y2tics ('0%%'  0, '10%%' 10, '20%%' 20, '30%%' 30, '40%%' 40, '50%%' 50, '60%%' 60, '70%%' 70, '80%%' 80, '90%%' 90, '100%%' 100)
    

    【讨论】:

      猜你喜欢
      • 2018-08-28
      • 1970-01-01
      • 2022-04-08
      • 1970-01-01
      • 1970-01-01
      • 2013-05-01
      • 1970-01-01
      • 2010-11-03
      • 2012-01-05
      相关资源
      最近更新 更多