# Tracing a graph in sagemath

So far my journey into the math world, I have relied on TI-83 calculator a lot to make graphs (as well as trace them).

As far as I know, I can only plot a graph with sagemath. Is there any way to trace a graph?

edit retag close merge delete

Graph Trace lets you move a trace cursor over the points of a graph or plot and displays value information. On TI calculators there a button labeled TRACE, that does just that.

1

Sort by » oldest newest most voted You can construct an interactive graph with a slider to trace the plotted function. As a proof of concept, you can check the interact given in this SageMath Cell. For the sake of completeness, I copy here the corresponding code:

f(x) = sin(2*x)-3*cos(x)
xmin = -2*pi
xmax = 4*pi
@interact
def _(xx=slider(xmin,xmax,default=xmin,label="x"),
trace=checkbox(default=False,label="Trace")):
p = plot(f(x), (x,xmin,xmax), color="green")
if trace:
p += text(r"$({0:f},{1:f})$".format(float(xx),float(f(xx))),(xx,f(xx)),
color="black", vertical_alignment="top")
p += point((xx,f(xx)), color="red", size=30)
show(p)

more
{"ft_lang_label":"__label__en","ft_lang_prob":0.6781105,"math_prob":0.9946833,"size":862,"snap":"2020-45-2020-50","text_gpt3_token_len":235,"char_repetition_ratio":0.092074595,"word_repetition_ratio":0.0,"special_character_ratio":0.29466358,"punctuation_ratio":0.1734694,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9981251,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-05T05:01:19Z\",\"WARC-Record-ID\":\"<urn:uuid:4fa1be57-6b56-4592-b811-731a8ab12a21>\",\"Content-Length\":\"64251\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1caf2b13-1fcb-41a1-8e58-a4f86fccdcf5>\",\"WARC-Concurrent-To\":\"<urn:uuid:6ebb317b-655c-4880-af0c-6fc9fb0ddcc8>\",\"WARC-IP-Address\":\"140.254.118.68\",\"WARC-Target-URI\":\"https://ask.sagemath.org/question/50100/tracing-a-graph-in-sagemath/\",\"WARC-Payload-Digest\":\"sha1:AYGBABFDNYCR544BQLP76WJB32IKNJAJ\",\"WARC-Block-Digest\":\"sha1:SWTIVUBZKL7GOO7LBKR6J5NHLMBPLLFW\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141746320.91_warc_CC-MAIN-20201205044004-20201205074004-00683.warc.gz\"}"}