Gnuplot填充曲线翻转轴 [英] Gnuplot filledcurves flip axes

查看:41
本文介绍了Gnuplot填充曲线翻转轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种样式可以填充x的两个函数之间的空间. 可以找到这样的图的例子,例如.在 http://gnuplot.sourceforge.net/demo/fillbetween.html 有什么方法可以绘制相似的图,但是x和y轴是翻转的? 这是所需的曲线形状(当然,没有旋转/镜像的标签,标题和图例)...

There is a style to fill the space between two functions of x. Examples of such plots can be found e.g. at http://gnuplot.sourceforge.net/demo/fillbetween.html Is there any way to make similar plot, but with flipped x and y axes? Here is the desired shape of a curve (without rotated/mirrored labels, titles and legends, of course)...

可以使用闭合轮廓完成操作(例如此处的最后一个示例 http://www.gnuplot .info/demo_svg_cvs/fillcrvs.html ),但这将需要重新整理数据文件.还有其他选择吗?

It could be done with closed contour (like last example here http://www.gnuplot.info/demo_svg_cvs/fillcrvs.html), but this would require reshuffling the data file. Any other options?

谢谢!

推荐答案

您不能直接执行此操作.来自help filledcurves:

You can't do this directly. From help filledcurves:

第三个变量填充在同一组采样的两条曲线之间的区域 x坐标.它需要三列输入数据(x,y1,y2).

The third variant fills the area between two curves sampled at the same set of x coordinates. It requires three columns of input data (x, y1, y2).

我认为您不能直接指定(y,x1,x2).解决方法是,可以用某种颜色在y轴和较大函数之间的区域,然后用白色填充y轴和较小函数之间的区域:

I don't think you can specify (y, x1, x2) directly. As a workaround you can the area between the y axis and the larger function in some color, and then fill the area between the y axis and the smaller function in white:

x1(y) = cos(y)+1
x2(y) = cos(y)+2
xmax(y) = (x1(y) > x2(y) ? x1(y) : x2(y))
xmin(y) = (x1(y) < x2(y) ? x1(y) : x2(y))

plot '+' using (xmax($1)):1 with filledcurve y1, \
     '+' using (xmin($1)):1 with filledcurve y1 fillcolor rgb "white"

如果两个函数中的一个或两个都可以是负数,则可能需要稍微调整一下.

This probably has to be tweaked a little if one or both of the two functions can be negative.

这篇关于Gnuplot填充曲线翻转轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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