Re: [Scilab-users] datatips in multiple axes plot
Sorry, I missed a "2": function y = yblu(yin) y = -1 + log10(yin)*2/3 endfunction Stefan On 2021-10-01 12:58, Stefan Du Rietz wrote: Hello David, if you don't need automatic scaling, you could use drawaxis() to get the second and third y-axis and then scale the y-data of those lines to plot them in the first axes. In your figure: function y = yblu(yin) y = -1 + log10(yin)/3 endfunction function y = yred(yin) y = -1 + yin * 2/240 endfunction Then plot x and the function value of y. Regards Stefan On 2021-09-30 09:56, CHEZE David 227480 wrote: Dear all, I found a limitation in the datatip manager of any figure window, as illustrated in the screen capture below, from the “multiple scaled plots” example : the datatip manager can catch only the last axe that was plotted, in the example only the red curve. This is a pity since it might be needed to ask datatip for other curves as well when analysing experimental data for instance. I tried to set first axe as the current axes, sca(gcf().children(3)), but I didn’t manage to get the datatips for the first black curve. Do you see any reason for this limitation? Enhancement suggestion ? David ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] datatips in multiple axes plot
Hello David, if you don't need automatic scaling, you could use drawaxis() to get the second and third y-axis and then scale the y-data of those lines to plot them in the first axes. In your figure: function y = yblu(yin) y = -1 + log10(yin)/3 endfunction function y = yred(yin) y = -1 + yin * 2/240 endfunction Then plot x and the function value of y. Regards Stefan On 2021-09-30 09:56, CHEZE David 227480 wrote: Dear all, I found a limitation in the datatip manager of any figure window, as illustrated in the screen capture below, from the “multiple scaled plots” example : the datatip manager can catch only the last axe that was plotted, in the example only the red curve. This is a pity since it might be needed to ask datatip for other curves as well when analysing experimental data for instance. I tried to set first axe as the current axes, sca(gcf().children(3)), but I didn’t manage to get the datatips for the first black curve. Do you see any reason for this limitation? Enhancement suggestion ? David ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] datatips in multiple axes plot
David, if you can express your data by a function, maybe something like this can help? BR Philipp // ## //define functions for data generationfunction res=func1(x) res = sin(x);endfunction function res=func2(x) res = x .* x;endfunction function res=func3(x) res = exp(x);endfunction // define function for data tip callbackfunction res=dataTipByX(fhandle, p1handle, p2handle, p3handle) xTip = evstr(x_mdialog('select x value','x','10')); y1Tip = func1(xTip); y2Tip = func2(xTip); y3Tip = func3(xTip); a = fhandle.children(); sca(a(4)) datatipRemoveAll(); datatipCreate(p1handle,[xTip, y1Tip]); sca(a(3)) datatipRemoveAll(); datatipCreate(p2handle,[xTip, y2Tip]); sca(a(2)) datatipRemoveAll(); datatipCreate(p3handle,[xTip, y3Tip]); res = 0; endfunction // create datax= linspace(-100,100,100);y1 = func1(x);y2 = func2(x);y3 = func3(x); // create figure with plotsf = figure(); plot(x,y1);a1 = gca();e1 = gce();p1 = e1.children(); newaxes()plot(x,y2);a2 = gca();e2 = gce();p2 = e2.children(); newaxes()plot(x,y3);a3 = gca();e3 = gce();p3 = e3.children(); m1=uimenu(f,'label', 'DataTip', 'callback', "dataTipByX(f, p1, p2, p3)"); // do some figure editingf.background = 8; a2.filled = 'off';a3.filled = 'off'; a2.y_location = "middle"a3.y_location = "right" a3.log_flags = "nln" p1.thickness = 1;p2.thickness = 1;p3.thickness = 1; p2.foreground = 1;p3.foreground = 5; // ## Am Do., 30. Sept. 2021 um 13:15 Uhr schrieb Stéphane Mottelet < stephane.motte...@utc.fr>: > Hello, > > Having digged in the code of the entity picker some time ago, I think that > the problem can be fixed at the Java level. Please create an issue on > Bugzilla. > > S. > > Le 30 sept. 2021 à 13:10, CRETE Denis a > écrit : > > > > Hello, > > I tried to use the example of “newaxes” in the help files, but I can’t > create any datatip (because of frames ???)… > > With the example of “sca” in the help files, I can create datatips on all > 3 curves (distributed on 2 different sets of axes). In this case, the > subplots do not overlap. > > If the axes_bounds vectors are changed to [0,0,1,1] for both sets of axes, > so that now they overlap, then I could not create datatips anymore. > > > > If you are looking for a workaround, then changing the order of the axes > may be a solution. It should be possible to implement it by a new menu > button created with uimenu (and as many submenus as the number of axes -1), > each with a callback like “swap_handles(axes_1, axes_n)”. > > HTH > > Denis > > > > *De :* users *De la part de* CHEZE David > 227480 > *Envoyé :* jeudi 30 septembre 2021 09:57 > *À :* Users mailing list for Scilab > *Objet :* [Scilab-users] datatips in multiple axes plot > > > > Dear all, > > > > I found a limitation in the datatip manager of any figure window, as > illustrated in the screen capture below, from the “multiple scaled plots” > example : the datatip manager can catch only the last axe that was plotted, > in the example only the red curve. This is a pity since it might be needed > to ask datatip for other curves as well when analysing experimental data > for instance. > > I tried to set first axe as the current axes, sca(gcf().children(3)), but > I didn’t manage to get the datatips for the first black curve. > > Do you see any reason for this limitation? Enhancement suggestion ? > > > > > > David > > > > > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] datatips in multiple axes plot
Hello, I tried to use the example of "newaxes" in the help files, but I can't create any datatip (because of frames ???)... With the example of "sca" in the help files, I can create datatips on all 3 curves (distributed on 2 different sets of axes). In this case, the subplots do not overlap. If the axes_bounds vectors are changed to [0,0,1,1] for both sets of axes, so that now they overlap, then I could not create datatips anymore. If you are looking for a workaround, then changing the order of the axes may be a solution. It should be possible to implement it by a new menu button created with uimenu (and as many submenus as the number of axes -1), each with a callback like "swap_handles(axes_1, axes_n)". HTH Denis De : users De la part de CHEZE David 227480 Envoyé : jeudi 30 septembre 2021 09:57 À : Users mailing list for Scilab Objet : [Scilab-users] datatips in multiple axes plot Dear all, I found a limitation in the datatip manager of any figure window, as illustrated in the screen capture below, from the "multiple scaled plots" example : the datatip manager can catch only the last axe that was plotted, in the example only the red curve. This is a pity since it might be needed to ask datatip for other curves as well when analysing experimental data for instance. I tried to set first axe as the current axes, sca(gcf().children(3)), but I didn't manage to get the datatips for the first black curve. Do you see any reason for this limitation? Enhancement suggestion ? David [cid:image001.png@01D7B5F6.9E231300] ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] datatips in multiple axes plot
Hello, Having digged in the code of the entity picker some time ago, I think that the problem can be fixed at the Java level. Please create an issue on Bugzilla. S. > Le 30 sept. 2021 à 13:10, CRETE Denis a écrit : > > > Hello, > I tried to use the example of “newaxes” in the help files, but I can’t create > any datatip (because of frames ???)… > With the example of “sca” in the help files, I can create datatips on all 3 > curves (distributed on 2 different sets of axes). In this case, the subplots > do not overlap. > If the axes_bounds vectors are changed to [0,0,1,1] for both sets of axes, so > that now they overlap, then I could not create datatips anymore. > > If you are looking for a workaround, then changing the order of the axes may > be a solution. It should be possible to implement it by a new menu button > created with uimenu (and as many submenus as the number of axes -1), each > with a callback like “swap_handles(axes_1, axes_n)”. > HTH > Denis > > De : users De la part de CHEZE David 227480 > Envoyé : jeudi 30 septembre 2021 09:57 > À : Users mailing list for Scilab > Objet : [Scilab-users] datatips in multiple axes plot > > Dear all, > > I found a limitation in the datatip manager of any figure window, as > illustrated in the screen capture below, from the “multiple scaled plots” > example : the datatip manager can catch only the last axe that was plotted, > in the example only the red curve. This is a pity since it might be needed to > ask datatip for other curves as well when analysing experimental data for > instance. > I tried to set first axe as the current axes, sca(gcf().children(3)), but I > didn’t manage to get the datatips for the first black curve. > Do you see any reason for this limitation? Enhancement suggestion ? > > > David > > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] datatips in multiple axes plot
Dear all, I found a limitation in the datatip manager of any figure window, as illustrated in the screen capture below, from the "multiple scaled plots" example : the datatip manager can catch only the last axe that was plotted, in the example only the red curve. This is a pity since it might be needed to ask datatip for other curves as well when analysing experimental data for instance. I tried to set first axe as the current axes, sca(gcf().children(3)), but I didn't manage to get the datatips for the first black curve. Do you see any reason for this limitation? Enhancement suggestion ? David [cid:image001.png@01D7B5DE.8B7D70A0] ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users