How so I plot functions or lines on top of a scatter plot?

18 views
Skip to first unread message

dead...@gmail.com

unread,
May 26, 2016, 5:01:31 PM5/26/16
to Google Visualization API
Hi, I need to do something really simple but I haven't found any examples as yet.

All I need to do is plot three straight lines on a scatter plot. Two of which are simply y=some_constant and the third being y=b0+b1x. I may want to add a couple more lines at x=some_constant.

I can make the lines in a separate graph by creating a line graph and plotting the endpoints (this would not work for vertical lines, however). I don't know how to plot them all on one graph without calculating Y for every X in the existing scatter plot. 

Any help would be appreciated. Thanks!

Daniel LaLiberte

unread,
May 26, 2016, 5:41:46 PM5/26/16
to Google Visualization API
Scatter points can be connected by lines.  I suggest that you just add a few more series (more columns) where you compute the data from your functions, and then for these series, specify the series type as 'line'.    The more complete documentation on the 'series' option can be found under the ComboChart page:  https://developers.google.com/chart/interactive/docs/gallery/combochart#configuration-options

Hope that helps.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/838e87ef-d6dc-4043-a4c2-0eecc6dfed43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

dead...@gmail.com

unread,
May 26, 2016, 8:30:11 PM5/26/16
to Google Visualization API
Yeah, thanks. It kinda works for plotting my Y-limits and regression but still no X-limit solution :)


On Thursday, May 26, 2016 at 2:41:46 PM UTC-7, Daniel LaLiberte wrote:
Scatter points can be connected by lines.  I suggest that you just add a few more series (more columns) where you compute the data from your functions, and then for these series, specify the series type as 'line'.    The more complete documentation on the 'series' option can be found under the ComboChart page:  https://developers.google.com/chart/interactive/docs/gallery/combochart#configuration-options

Hope that helps.
On Thu, May 26, 2016 at 5:01 PM, <dead...@gmail.com> wrote:
Hi, I need to do something really simple but I haven't found any examples as yet.

All I need to do is plot three straight lines on a scatter plot. Two of which are simply y=some_constant and the third being y=b0+b1x. I may want to add a couple more lines at x=some_constant.

I can make the lines in a separate graph by creating a line graph and plotting the endpoints (this would not work for vertical lines, however). I don't know how to plot them all on one graph without calculating Y for every X in the existing scatter plot. 

Any help would be appreciated. Thanks!

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--
Reply all
Reply to author
Forward
0 new messages