在一个图中绘制 4 条曲线,具有 3 个 y 轴 [英] Plotting 4 curves in a single plot, with 3 y-axes

查看:27
本文介绍了在一个图中绘制 4 条曲线,具有 3 个 y 轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 4 组值:y1y2y3y4 和一组 x.y 值具有不同的范围,我需要将它们绘制为单独的曲线,在 y 轴上具有单独的一组值.

简单来说,我需要 3 个具有不同值(比例)的 y 轴来绘制同一个图形.

感谢任何帮助,或有关查找位置的提示.

解决方案

这是一个很好的机会,可以向您介绍
(来源:mathworks.com)

我刚刚搜索了plotyy";在 文件交换.

虽然了解正在发生的事情很重要,但有时您只需要完成事情,而不是自己做.Matlab Central 非常适合这一点.

I have 4 sets of values: y1, y2, y3, y4 and one set x. The y values are of different ranges, and I need to plot them as separate curves with separate sets of values on the y-axis.

To put it simple, I need 3 y-axes with different values (scales) for plotting on the same figure.

Any help appreciated, or tips on where to look.

解决方案

This is a great chance to introduce you to the File Exchange. Though the organization of late has suffered from some very unfortunately interface design choices, it is still a great resource for pre-packaged solutions to common problems. Though many here have given you the gory details of how to achieve this (@prm!), I had a similar need a few years ago and found that addaxis worked very well. (It was a File Exchange pick of the week at one point!) It has inspired later, probably better mods. Here is some example output:


(source: mathworks.com)

I just searched for "plotyy" at File Exchange.

Though understanding what's going on in important, sometimes you just need to get things done, not do them yourself. Matlab Central is great for that.

这篇关于在一个图中绘制 4 条曲线,具有 3 个 y 轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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