I have three parameters x
,y
and t
. But the problem is my file structure.
My files are named as:
e_x_y.txt
t_x_y.txt
where e_x_y.txt
has the error for particular values of x
and y
and t_x_y.txt
has corresponding time values.
I need to plot the values in e_x_y.txt
on a x vs y vs t
graph.
What is the best way to do that?
I know what x and y values are, so I don't have to deduct them from the file names.
To make things more clear,
suppose my files are:
e_4_5.txt
45
54
t_4_5.txt
2.0
6.0
e_7_8.txt
32
98
121
t_7_8.txt
2
9
1.0
I want to plot the following points:
(4,5,2.0) = 45
(4,5,6.0) = 54
(7,8,2.0) = 32
(7,8,9.0) = 98
(7,8,1.0) = 121
Even though I am not convinced this the best way to visualize the data, here's a simple way to do it as you asked. You can plot the 3D points in a simple scatter plot, and map the size OR the color to the values of the fourth dimension
error
. Something like:The type of plot you are trying to make may be difficult to visualize well. I can give you two suggestions: one is what you want, and one is what you should probably do instead...
Plotting 4-D data:
In order to do this, you will have to plot a series of
x,y,t
points and somehow represent the error valuee
at each point. You could do this by changing the color or size of the point. In this example, I'll plot a sphere at each point with a diameter that varies based on the error (a diameter of 1 equates to the maximum expected error). The color represents the time. I'll be using the sample data you added to the question (formatted as a 5-by-4 matrix with the columns containing thex
,y
,t
, ande
data):And here's what it would look like:
The problem: Although the plot looks kind of interesting, it's not very intuitive. Also, plotting lots of points in this way will get cluttered and it will be hard to see them all well.
More intuitive 3-D plot:
It may be better to instead make a 3-D plot of the data, since it may be easier to interpret. Here, the x-axis represents the iteration number and the y-axis represents each individual network:
This produces a much clearer plot: