Y轴右侧的多余空间 [英] Redundant space at right side of Y axis

查看:35
本文介绍了Y轴右侧的多余空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用GNU绘图绘制一些实验数据,但是我无法弄清楚如何删除Y轴与第一个样本(第一个样本的左侧)之间的多余填充/空间:

I'm trying to make plot with GNU Plot for some data of experiments, but I cannot figure how to remove the redundant padding/space between Y axis and the first sample (left side of the first sample):

代码:

set terminal pngcairo size 800,800 enhanced font 'WenQuanYiZenHei,12'
set title "All Elements"
set xlabel "Sample"
set ylabel "Element Amounts"

set ytics nomirror
set style fill transparent solid 0.5 noborder
plot data u 2:xticlabels(1) w histograms title "K",\
     data u 3:xticlabels(1) w histograms title "Ca",\
     data u 4:xticlabels(1) w histograms title "Mg",\
     data u 5:xticlabels(1) w histograms title "Fe",\
     data u 6:xticlabels(1) w histograms title "Mn",\
     data u 7:xticlabels(1) w histograms title "Zn"

数据:

| Sample |     K |    Ca |   Mg |     Fe |    Mn |   Zn |
|--------+-------+-------+------+--------+-------+------|
| -Ca 1U | 58800 |  4800 | 2700 |  222.5 |  28.0 | 30.0 |
| -Ca 2U | 59000 |  5475 | 3200 |  105.5 |  29.5 | 35.0 |
| -Mg 1U | 57600 | 12275 | 2900 |   92.0 |  45.5 | 37.0 |
| -Mg 2U | 57200 | 13850 | 3200 |  266.0 |  59.5 | 39.0 |
|--------+-------+-------+------+--------+-------+------|
| -Ca 1D | 19700 |  1100 | 3400 | 1708.0 |  79.0 | 48.5 |
| -Ca 2D | 20900 |  1025 | 3300 | 1812.0 | 102.5 | 54.5 |
| -Mg 1D | 23200 |  3175 | 3200 |  312.0 |  49.5 | 61.0 |
| -Mg 2D | 21800 |  4325 | 2300 | 2136.0 |  86.5 | 55.5 |

推荐答案

这是因为数据中的标题行.您可以使用

That's because of the header line in the data. You can skip it with

plot data every ::1 u 2: ...

或者只是在将数据提供给gnuplot之前将其删除.

Or just remove it before feeding the data to gnuplot.

这篇关于Y轴右侧的多余空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆