简体   繁体   English

定义了JFreeChart域/范围轴

[英]JFreeChart domain/range axes defined

Could somebody provide a simple explanation of the JFreeChart axis-types? 有人可以提供JFreeChart轴类型的简单解释吗?

  1. First, we have the axes that are based on the class hierarchy (ValueAxis, CategoryAxis, lots of subclasses) 首先,我们有基于类层次结构的轴(ValueAxis,CategoryAxis,许多子类)

  2. We also have the "domain axis" versus "range axis" distinction (only for xy plots?). 我们还有“域轴”与“范围轴”的区别(仅适用于xy图?)。 It is not entirely clear how these relate to the class-hierarchy-based axes. 它们与基于类层次结构的轴的关系并不完全清楚。 These are not classes but there are setDomainAxis and setRangeAxis methods in XYPlot. 这些不是类,但XYPlot中有setDomainAxis和setRangeAxis方法。

  3. Visually I would think in horizontal and vertical axes, I am not sure how these are related to the previous concepts (is "domain" always horizontal?). 在视觉上我会想到在水平轴和垂直轴上,我不确定这些是如何与之前的概念相关的(“域”总是水平的?)。 I think that the x-axis is horizontal and the y-axis vertical, but I am not sure whether this is always the case with XYPlot. 我认为x轴是水平的,y轴是垂直的,但我不确定XYPlot是否总是如此。

EDIT: I tried to study both the API docs and the developer guide. 编辑:我试图研究API文档和开发人员指南。 The API docs just give a hierarchy of classes, but it is not clear when and how to use them. API文档只是给出了类的层次结构,但不清楚何时以及如何使用它们。 The developer guide also gives no definition or explanation of "domain axis" and "range axis", it just uses these terms. 开发人员指南也没有给出“域轴”和“范围轴”的定义或解释,它只是使用这些术语。 I admit that the question is broad, it is because I could not find this basic information anywhere. 我承认问题很广泛,因为我无法在任何地方找到这些基本信息。 I wanted to have a general understanding, but my most important question at the moment is what determines what gets to be on the horizontal/vertical axis (is "domain" always horizontal? if not how to set it?) because I am getting some crazy results and I don't know where to start the debugging. 我想要有一个大致的理解,但我现在最重要的问题是决定水平/垂直轴上的内容(“域”是否总是水平?如果不是如何设置它?)因为我得到一些疯狂的结果,我不知道从哪里开始调试。 It is also not clear whether I should use CombinedRangeXYPlot or CombinedDomainXYPlot if I want the two plots to be placed one above the other. 如果我想将两个图放在一个上面,我还不清楚是否应该使用CombinedRangeXYPlot或CombinedDomainXYPlot。

EDIT2: Although this was not answered, I found out in the meantime what determines whether the domain axis is horizontal: the PlotOrientation setting. EDIT2:虽然没有回答,但我在此期间发现了什么决定了域轴是否是水平的: PlotOrientation设置。 This setting (on the level of combined plot) also determines whether CombinedRangeXYPlot/CombinedDomainXYPlot arrange the two plots horizontally or vertically. 此设置(在组合图的级别上)还确定CombinedRangeXYPlot / CombinedDomainXYPlot是水平还是垂直排列两个图。

In a XYPlot , every series that you are displaying represents a discrete function f[t] with a discrete set of t's {t1, t2, ..., tn} and their corresponding values {f[t1], f[t2], ..., f[tn]} . XYPlot ,您显示的每个系列都代表一个离散函数f[t] ,其中包含一组离散的t {t1,t2,...,tn}及其对应的值{f [t1],f [t2], ......,f [tn]}

  • The domain of the function is holding all possible values of t . 函数的保存t所有可能值。
  • The range of the function holds all possible values of the function f[t] . 函数的范围包含函数f[t]所有可能值。

The important thing here is that there can be multiple points in the function with the same value in the range axis, but every point of the function has to have a unique value in the domain axis. 这里重要的是函数中可以有多个点,并且在范围轴中具有相同的值,但是函数的每个点都必须在域轴中具有唯一值。 For instance: Bananas can have the same prize as Apples, but there can not be two prizes for a Banana (tell that to the brokers! :P). 例如:香蕉可以和苹果一样获奖,但香蕉不能有两个奖品(告诉经纪人!:P)。

Usually, the horizontal axis is the domain axis, but that can also be changed. 通常,水平轴是域轴,但也可以更改。

Then you have the class Axis which holds a lot of possible types of visual representations of axes (logarithmic/linear/category/no labels/gridlines/blue colored axis line...). 然后你有Axis类,它包含许多可能类型的轴视觉表示 (对数/线性/类别/无标签/网格线/蓝色轴线......)。

So in summary: Domain and range are mathematical definitions and pose some constraints on the displayed data. 总而言之:域和范围是数学定义,并对显示的数据构成一些约束。 The terms are used for a special kind of data (the classical form of a function that everybody learns in basic school). 这些术语用于特殊类型的数据(每个人在基础学校学习的函数的经典形式)。 They have nothing to do with their visual represenation. 它们与视觉表现无关。 So the range as well as the domain axis of a plot can be defined to be a CategoryAxis , a NumberAxis , a LogarithmicAxis or something else. 因此,绘图的范围和域轴可以定义为CategoryAxisNumberAxisLogarithmicAxis或其他。

EDIT (for completeness): You can change the orientation of the plot (ie define, which of the axes is the range axis) using PlotOrientation.VERTICAL / PlotOrientation.HORIZONTAL . 编辑(完整性):您可以使用PlotOrientation.VERTICAL / PlotOrientation.HORIZONTAL更改绘图的方向(即定义,哪个轴是范围轴)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM