Gnuplot:填充区域由左/右曲线界定吗? [英] Gnuplot: fill area bounded by curves left/right?

查看:56
本文介绍了Gnuplot:填充区域由左/右曲线界定吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个定义两个曲线的数据集,我想填充它们之间的区域.但是,与标准情况相反,横坐标绘制在垂直轴上,纵坐标绘制在水平轴上.横坐标表示深度,这是地球物理学中常见的绘图格式.换句话说,我想要类似

I have a dataset that defines two curves, and I want to fill the area between them. However, contrary to the standard situation, the abscissa is to be plotted on the vertical axis and the ordinates on the horizontal one; the abscissa indicates depth, this is a common plotting format in geophysics. In other words, I want something like

 plot 's.dat' u 1:2:3 w filledcurves

但具有互换的轴,因此,填充区域不在曲线的顶部和底部,而是在左侧和右侧,如在

but with swapped axes so that the filled area is bounded not at the top and bottom but to the left and right by the curves as seen in

plot 's.dat' u 2:1,'s.dat' u 3:1

我的数据集是这样的:

0.      -1.776  -0.880
160.    -1.775  -0.882
160.    -1.692  -0.799
320.    -1.692  -0.800
320.    -1.531  -0.634
480.    -1.534  -0.637
480.    -1.286  -0.394

在Gnuplot中有可能吗?

Is this possible in Gnuplot?

托马斯

推荐答案

这是使用带有zerror"的3D绘图样式的完全不同的解决方案.为此,您将需要当前的gnuplot(5.2版).绘图样式的确不是为此设计的,因此存在一些困难(例如x tic标记不可见,因为它是垂直于绘图平面绘制的,所有tic标记都需要偏移以提高可读性).

This is a totally different solution using 3D plot style "with zerror". You will need current gnuplot (version 5.2) for this. The plot style was really not designed for this so there are some difficulties (e.g. x tic marks invisible because drawn perpendicular to the plane of the plot, all tic labels requiring an offset for readability).

#
# [mis]use 3D plot style "with zerror" to create a plot of the xz
# plane with area fill between two sets of data points with
# equal coordinates on the vertical axis (x) but contrasting
# values on the horizontal axis (z).
#

set view 270, 0
set view azimuth -90
set xyplane at 0
unset ytics
set ztics offset  4, -2 out
set xtics offset  4

splot 's.dat' using 1:(0):(0.5*($2+$3)):2:3 with zerror notitle

这篇关于Gnuplot:填充区域由左/右曲线界定吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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