Querying z-values in cranvas qtime

19 views
Skip to first unread message

alobo...@gmail.com

unread,
Nov 19, 2013, 8:17:56 AM11/19/13
to cra...@googlegroups.com

I need to interactively explore profiles of of a y variable (reflectance) against an x variable (wavelength) in plots that are very similar to time plots. My problem is that besides checking the exact x,y values, I also would need to get the channel (that is, a third variable). I do not see a way of doing this with qplot(), is it? Actually, if using the "?" key with qscatter() you get x,y and ID, so we are not that far...

Thanks,

Agus

Xiaoyue Cheng

unread,
Nov 19, 2013, 10:34:32 AM11/19/13
to cra...@googlegroups.com, alobo...@gmail.com
If you want something similar to time plots for multivariate time series, try
qtime(x, y, qdata, group=z)

Best,
Xiaoyue




--
You received this message because you are subscribed to the Google Groups "cranvas" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cranvas+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

alobo...@gmail.com

unread,
Nov 19, 2013, 11:22:05 AM11/19/13
to cra...@googlegroups.com, alobo...@gmail.com
Thanks.
But in that case the line between points is eliminated
chann <- paste("B",qnasa$TimeIndx,sep="_")
minasa2221 <- cbind(nasa2221,chann=chann)
qminasa <- qdata(minasa2221)
qtime(time=TimeIndx, y=ts, data=qminasa, group=chann)

And in any case, this solution with group would apply in the case in which, as in the example I mentioned about the channels, the z variable is categorical.

But for the case in which z is continuous the only solution I can find in the help page is as in the pigs example: plotting several "y" variables.
I understand this is interesting in many cases, but in many others you are interested on the time (or wavelength) dependence
of only one variable "y", thus the rest of variables just make the plot confusing. For example, consider the case in which
you have a correct qplot with
qtime(time=TimeIndx, y=ts, data=qnasa)

but then you are interested on checking the values of o3_tovs at the peaks.
Perhaps there is a way of linking the qtime plot to the table so that you select a point
in the graphic and get the values of the corresponding  row in the table (or a subset of predefined variables of interest)?

Agus

Xiaoyue Cheng

unread,
Nov 19, 2013, 12:14:32 PM11/19/13
to cra...@googlegroups.com, alobolistas
On Tue, Nov 19, 2013 at 10:22 AM, <alobo...@gmail.com> wrote:
Thanks.
But in that case the line between points is eliminated
chann <- paste("B",qnasa$TimeIndx,sep="_")
minasa2221 <- cbind(nasa2221,chann=chann)
qminasa <- qdata(minasa2221)
qtime(time=TimeIndx, y=ts, data=qminasa, group=chann)



I guess I don't understand your problem very well. Here you set every time point in a unique group, so totally you have 72 groups for 72 data points, which will not connect any points by group, because every group only contains one value.

 
And in any case, this solution with group would apply in the case in which, as in the example I mentioned about the channels, the z variable is categorical.

But for the case in which z is continuous the only solution I can find in the help page is as in the pigs example: plotting several "y" variables.
I understand this is interesting in many cases, but in many others you are interested on the time (or wavelength) dependence
of only one variable "y", thus the rest of variables just make the plot confusing. For example, consider the case in which
you have a correct qplot with
qtime(time=TimeIndx, y=ts, data=qnasa)

but then you are interested on checking the values of
o3_tovs at the peaks.


Please try:
qtime(time=TimeIndx, y=c('ts','o3_tovs'), data=qnasa)

Then press Shift + U to separate two series, and Shift + D to merge the series.

 
Perhaps there is a way of linking the qtime plot to the table so that you select a point
in the graphic and get the values of the corresponding  row in the table (or a subset of predefined variables of interest)?


You can always link between several plots. For example,

qtime(time=TimeIndx, y=ts, data=qnasa)
qscatter(ts, o3_tovs, data=qnasa)

Then brush some points, you will see highlights on both plots.

 

alobo...@gmail.com

unread,
Nov 20, 2013, 4:02:52 AM11/20/13
to cra...@googlegroups.com, alobolistas
Xiaoyue,


On Tuesday, November 19, 2013 6:14:32 PM UTC+1, Xiaoyue Cheng wrote:


On Tue, Nov 19, 2013 at 10:22 AM, <alobo...@gmail.com> wrote:
Thanks.
But in that case the line between points is eliminated
chann <- paste("B",qnasa$TimeIndx,sep="_")
minasa2221 <- cbind(nasa2221,chann=chann)
qminasa <- qdata(minasa2221)
qtime(time=TimeIndx, y=ts, data=qminasa, group=chann)



I guess I don't understand your problem very well. Here you set every time point in a unique group, so totally you have 72 groups for 72 data points, which will not connect any points by group, because every group only contains one value.
 

This was just a work-around to get the z values also at clicking a point. It works, but the line is lost, thus it is not a good work around.
 
Both solutions you provide below are good. For the one linking the graphics, I just should explore if there is something better than the scatter plot in this case.

Nevertheless, from a user point of view, having something like
qtime(time=TimeIndx, y=ts, z=o3_tovs, data=qnasa)
(indicating that the plot is made by y vs x but the "tips note" shows the values for x,y,z)
would be easier.

Thanks a lot for your help.
Agus


Xiaoyue Cheng

unread,
Nov 20, 2013, 11:57:04 AM11/20/13
to cra...@googlegroups.com, alobolistas
Now I see what you mean -- to get more info under the identify mode. Currently we don't allow the user to add something to the label, but it is possible to change the setting later.

Best,
Xiaoyue


Reply all
Reply to author
Forward
0 new messages