[Scilab-users] issue with xs2png

P M p.muehlmann at gmail.com
Mon Feb 25 20:37:44 CET 2019


no...I'm not (yet) prime minister :-))

What do I mean? Please, check this small example:

clear();clc;xdel();x = linspace(1,10);y = x .* x;f1 =
figure();f1.background = 8;title ('my title','position',[10
100]);subplot(221);plot(x,y);a1 = gca();a1.data_bounds =
[0,0;10,100];a1.tight_limits = ["on","on","off"];

so far so good.

change to:     a1.data_bounds = [0,0;10,200];

You see that the title position changes.

I need to play with a1.data_bounds.

This is because my diagram representes data from a file and each file
content may change the Y-axis...so I can not have a fixed value for
a1.data_bound.

I probably could figure out how to set the Y-position of the title
with respect to max(y).

I just thought it is quite nice, if the position of the title would be
depending on just the figure size and not on the axis scale.

Cheers, Philipp









Am Mo., 25. Feb. 2019 um 17:26 Uhr schrieb Samuel Gougeon <sgougeon at free.fr
>:

> Hello P M
> (Prime Minister ?)
>
> Le 25/02/2019 à 17:10, P M a écrit :
>
> Dear all,
>
> I am building a figure with 4 subplots.
>
> Now since I want to have a title in the figure I can use several options
> to set a title on the figure.
>
> Currently I use
>
> subplot(221);
> plot(...)
> a1 = gca();
> a1.title.Text = "my title";
>
> However so far I understand, the title position is somehow bound to the axis settings.
> such as: if   xmin xMax yMin yMax are changing the position of the title also changes.
>
> Now: I need to have the title position independend of the axis settings.
>
>
> What do you mean? The position of the title can be explicitly set with
>
> title("My title", "position",[xtitle, ytitle])
>
> where the coordinates [xtitle, ytitle] are given in data scale.
>
> Using this,  a1.title.auto_position is turned "off", and the position
> that you set should remain independent of any changes of data bounds.
> Isn't it the case?
>
> HTH
> Samuel
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190225/11d8e0d4/attachment.htm>


More information about the users mailing list