【问题标题】:xtic labels disappears (along x-axis) at the bottom of the graphxtic 标签在图表底部消失(沿 x 轴)
【发布时间】:2014-07-16 13:03:19
【问题描述】:

我正在尝试使用“gnuplot”绘制直方图。我使用的代码很糟糕:

#!/usr/bin/gnuplot

###PNG
set terminal pngcairo size 650,550 enhanced dash font "arial,10" #fontscale 1.20
set output "hb-maltoLyo12per.png"

set macro
labelFONT="font 'Arial,23'"
scaleFONT="font 'Arial,18'"
scaleFONT2="font 'Arial,13'"


set boxwidth 0.75 absolute
set style fill solid 1.00 border -1
set style histogram rowstacked
set style data histograms

set xtic  rotate by -30  1000 nomirror  @scaleFONT2 offset character -1, 0, 0
set ytics 100 nomirror  @scaleFONT
set mxtics 2
set mytics 5
set ytics 2
set yrange [0:10]
set ylabel "Hydrogen Bond"  @labelFONT
set xlabel ''                      

plot 'data_average_HB.dat' using 2 t "Inter-moleculear HB", '' using 3:xticlabels(1) t "Lipid to Solvent HB" with histogram

使用上面的代码,我得到了一个图,如图所示

xtics 标签(沿 x 轴)隐藏在图表下方。每一句都是长句。我希望它们看起来可见。

我的代码中是否缺少任何内容?我怎样才能做到这一点?

非常感谢。

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    Gnuplot 不太擅长估计特殊 tic 标签格式(例如长旋转标签)的边距。您可以使用set bmargin手动设置下边距。

    尝试使用

    set bmargin 4
    

    这将使用与所选字体的 4 个字符高度相对应的下边距。您可能需要根据您的情况调整 4

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-18
      相关资源
      最近更新 更多