I'm trying to use the CountourPlot and have a couple of questions.
I am using the DefaultContourDataset. I see the empty constructor but I don't see any addSeries or addValue type methods to fill the values so I guess this isn't really of any actual use. So I use the 4 arg constructor and try to put in the x, y and z value arrays.
I understand that the z array elements are the values of each of the points but I thought that the x and y for that point would be the x and y position of the associated z value - this doesn't appear to be the case.
I looked at the example code and it isn't clear (to me) what the x and y arrays are being set to. Somehow the class figures out some sort of index offset array using the data - don't see how that can work either. Is there a discussion somewhere of how to use this class?
Any help would be appreciated.
Richard
Contour Plot Questions
Re: Contour Plot Questions
Richard:
You are correct, the default constructor produces an object without data and no provision is provided to insert data. I should either remove it, or include the necessary method(s) to allow data to be inserted.
I took a looked at ContourPlotDemo. I intended to show what the plot created, and as such I failed to produce a reasonable example of constructing a dataset. I may have corrected this with some recent modifications that I need to get to David Gilbert.
As you have stated, the x and y values are the position (horizontal and vertical), and z are the magnitude at these locations. I assume that the data are arranged such that there are multiple y-values at a single x-value (although the ContourDataset expects that the triplet with repeating x values are provide). When the data are rendered, I assume that the z-value at the position defined by x and y applies to the region extending 1/2 of the distance to the neighboring points (that is the points above and below, left and right). I do this rendering by moving along the y-axis at a fixed value of x. When I "run out of values" I step to the next x value and so on….
By the way, I have found a few layout errors, and will get these David shortly.
Dave OD
You are correct, the default constructor produces an object without data and no provision is provided to insert data. I should either remove it, or include the necessary method(s) to allow data to be inserted.
I took a looked at ContourPlotDemo. I intended to show what the plot created, and as such I failed to produce a reasonable example of constructing a dataset. I may have corrected this with some recent modifications that I need to get to David Gilbert.
As you have stated, the x and y values are the position (horizontal and vertical), and z are the magnitude at these locations. I assume that the data are arranged such that there are multiple y-values at a single x-value (although the ContourDataset expects that the triplet with repeating x values are provide). When the data are rendered, I assume that the z-value at the position defined by x and y applies to the region extending 1/2 of the distance to the neighboring points (that is the points above and below, left and right). I do this rendering by moving along the y-axis at a fixed value of x. When I "run out of values" I step to the next x value and so on….
By the way, I have found a few layout errors, and will get these David shortly.
Dave OD
Re: Contour Plot Questions
Hi Dave,
I'll look forward to receiving your updates. I did a bit of a rush job integrating your original code, and probably introduced a few problems. But I figured it would be easier to sort those out once the majority of the code was in the distribution...
Regards,
Dave Gilbert
I'll look forward to receiving your updates. I did a bit of a rush job integrating your original code, and probably introduced a few problems. But I figured it would be easier to sort those out once the majority of the code was in the distribution...
Regards,
Dave Gilbert