Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Subplot Scilab Vs Matlab

421 views
Skip to first unread message

fake...@invalid.domain

unread,
Oct 9, 2009, 7:46:24 PM10/9/09
to
In Scilab and Matlab for i = 1:16, subplot(4,4,i), plotthings end sets up an
4x4 array of subplots.

Matlab also allows for subplot(4,4,[9, 12]) or subplot(4,1,3) as a way
combining squares on the third row into a long graph. In scilab the
first command fails (in also fails for mtlb_scilab), the second command
doesn't cover the same squares, the resulting plot is not as wide.

5.1.1-alpha-1 on a mac
clf;
A = color("red");
for i=1:16, subplot(4,4,i); Matplot(A); xstring(1,1,sprintf("%d",i)); end
B = color("blue"); subplot(4,1,3); Matplot(B);

Hmmm... there doesn't seem to be a way to clf just a subplot region.


How does one divide the window into subplots like
+-+ +-+
| | | |
+-+ +-+
+-----+
| |
+-----+

subplot(2,2,1);Matplot(A);
subplot(2,2,2);Matplot(A);
subplot(2,1,2);Matplot(B);

xsetech([0.0,0.0,0.5,0.5]);Matplot(A);
xsetech([0.5,0.0,1.0,0.5]);Matplot(A);
xsetech([0.0,0.5,1.0,1.0]);Matplot(B);

both fail for different reasons.

Advice?
--
Steven Bellenot http://www.math.fsu.edu/~bellenot
Professor and Associate Chair phone: (850) 644-7405
Department of Mathematics office: 223 Love
Florida State University email: bellenot at math.fsu.edu

bruno

unread,
Oct 10, 2009, 4:00:37 AM10/10/09
to

> clf;
> A = color("red");
> for i=1:16, subplot(4,4,i); Matplot(A); xstring(1,1,sprintf("%d",i)); end
> B = color("blue"); subplot(4,1,3); Matplot(B);
>

This don't work exactly as you want because subplot don't change
the value "arect" corresponding to the margin. By default the margin
is 1/8 for 1 (if L is the total width of the plot window the small
plots
have (L/4)*1/8 left and right margin while the "big plot" have a L*
(1/8).
So to have the same margin as the other plots you need 1/32. Try :

clf


for i=1:16, subplot(4,4,i); Matplot(A); xstring(1,1,sprintf("%d",i));
end

B = color("blue"); xsetech(wrect=[0,0.5,1,1/4],arect=1/32*[1,1,1,1]);
Matplot(B);

hth
Bruno

bruno

unread,
Oct 10, 2009, 4:11:50 AM10/10/09
to

Nevertheless the solution don't work exactly
as expected because the larger of the vertical
tics marks are proportional to the plot width
and so the tics numbers are not positionned
as the others. Exploring the setting features
with the graphic editor don't show me a solution...

Bruno

Sam

unread,
Oct 13, 2009, 6:18:25 PM10/13/09
to
On 10 oct, 01:46, fakeu...@invalid.domain wrote:
> In Scilab and Matlab for i = 1:16, subplot(4,4,i), plotthings end sets up an
> 4x4 array of subplots.
>
> Matlab also allows for subplot(4,4,[9, 12]) or subplot(4,1,3) as a way
> combining squares on the third row into a long graph. In scilab the
> first command fails (in also fails for mtlb_scilab), the second command
> doesn't cover the same squares, the resulting plot is not as wide.

This effect has been reported as a bug in April. Some work was done
yesterday about that: See http://bugzilla.scilab.org/show_bug.cgi?id=4430
To be tested through the Master branch of Scilab, as it is a very
recent
update.

> 5.1.1-alpha-1 on a mac
> clf;
> A = color("red");
> for i=1:16, subplot(4,4,i); Matplot(A); xstring(1,1,sprintf("%d",i)); end
> B = color("blue"); subplot(4,1,3); Matplot(B);
>
> Hmmm... there doesn't seem to be a way to clf just a subplot region.

h=gca();
delete(h)
// does the job.

Regards
Samuel

0 new messages