Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Change language to: Français - Português - 日本語 - Русский

See the recommended documentation of this function

Scilab help >> Graphics > Datatips > datatipSetDisplay

# datatipSetDisplay

Set the function used to compute the datatip string.

### Calling Sequence

```datatipSetDisplay(curve_handle,fun)
datatipSetDisplay(curve_handle)```

### Arguments

tip_handle

A handle on a datatip.

fun

A variable that contains a function (type==11 or type==13). This function calling sequence must be `str=fun(curve, pt, index)` where `curve` is the handle of the polyline associated with the datatip, `pt` is the vector of datatip coordinates and `index` is the mesh point index of the datatip point or the index of the previous mesh point if interpolation is allowed.

This function must return a string or a vector of strings in `str`.

### Description

Set the function used to format the text to be displayed at the datatip point.

### Examples

```x=linspace(-1,1,1000);
clf()
plot(x,sinc(20*x),x,1-x^2);
e=gce();e=e.children;
d21=datatipCreate(e(2),600);
d22=datatipCreate(e(2),200);
d1=datatipCreate(e(1),700);

function str=mydisplay(curve, pt, index)
str=msprintf('sinc(%-0.2g)=%-0.2g', 20*pt(1),pt(2))
endfunction
datatipSetDisplay(e(2),mydisplay)``` The display function can also be used to place tip text in different locations:
```function str=infodisplay(curve, pt, index)
xinfo(msprintf('x=%0.2g,\t 1-x^2=%0.2g', pt(1),pt(2)))
str=''
endfunction
datatipSetDisplay(e(1),infodisplay) //tip text displayed in the info bar```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5074599,"math_prob":0.92641556,"size":1485,"snap":"2020-24-2020-29","text_gpt3_token_len":410,"char_repetition_ratio":0.15732613,"word_repetition_ratio":0.010152284,"special_character_ratio":0.24444444,"punctuation_ratio":0.14432989,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96786654,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-01T01:48:02Z\",\"WARC-Record-ID\":\"<urn:uuid:8b14d45f-308a-4544-a30a-29559196e79b>\",\"Content-Length\":\"30153\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7b0200e4-aa3b-4449-8989-9ce70518714b>\",\"WARC-Concurrent-To\":\"<urn:uuid:67e187e8-5836-478b-8438-1576df3af9e9>\",\"WARC-IP-Address\":\"176.9.3.186\",\"WARC-Target-URI\":\"https://help.scilab.org/docs/5.4.0/en_US/datatipSetDisplay.html\",\"WARC-Payload-Digest\":\"sha1:IZJ2CIW4GRBLDEG6TUWLOAJOFY6YFASZ\",\"WARC-Block-Digest\":\"sha1:APJVC5K6XST6ZYX3U77KJKGLLTBB7UPF\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347413901.34_warc_CC-MAIN-20200601005011-20200601035011-00425.warc.gz\"}"}