Revision history [back]

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor.

Example: %matlab

auto

%matlab clear;clc;clf; h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3 h2 = [1 -1]; % for n = 0,1 t=0:1:204; x = randn(1,200); hfig=figure(1); clf plot(x) hold on plot(conv(x,h1),'r') axis([1 500 -5 5]) hold on plot(conv(x,h2),'g') axis([1 50 -5 5]) legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside') print -dpng image.png

I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor.

Example: %matlab

auto

factor. Example:

%matlab
#auto
%matlab
clear;clc;clf;
h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3
h2 = [1 -1]; % for n = 0,1
t=0:1:204;
x = randn(1,200);
hfig=figure(1); clf
plot(x)
hold on
plot(conv(x,h1),'r')
axis([1 500 -5 5])
hold on
plot(conv(x,h2),'g')
axis([1 50 -5 5])
legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside')
print -dpng image.pngimage.png


I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor. Example:

%matlab
#auto
%matlab
clear;clc;clf;
h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3
h2 = [1 -1]; % for n = 0,1
t=0:1:204;
x = randn(1,200);
hfig=figure(1); clf
plot(x)
hold on
plot(conv(x,h1),'r')
axis([1 500 -5 5])
hold on
plot(conv(x,h2),'g')
axis([1 50 -5 5])
legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside')
print -dpng image.png


I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor. Example:

%matlab
#auto
%matlab
clear;clc;clf;
h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3
h2 = [1 -1]; % for n = 0,1
t=0:1:204;
x = randn(1,200);
hfig=figure(1); clf
plot(x)
hold on
plot(conv(x,h1),'r')
axis([1 500 -5 5])
hold on
plot(conv(x,h2),'g')
axis([1 50 -5 5])
legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside')
print -dpng image.png


I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.

Scaling of png in sage notebook

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor. Example:

#auto
%matlab
clear;clc;clf;
h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3
h2 = [1 -1]; % for n = 0,1
t=0:1:204;
x = randn(1,200);
hfig=figure(1); clf
plot(x)
hold on
plot(conv(x,h1),'r')
axis([1 500 -5 5])
hold on
plot(conv(x,h2),'g')
axis([1 50 -5 5])
legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside')
print -dpng image.png


This code saves the produced plot in the current folder directly.

I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.

 7 No.7 Revision kcrisman 11847 ●36 ●117 ●236

Scaling of png in sage notebookfrom Matlab

Hi

I have been trying find a way to prevent or control scaling of generated png's in the sage notebook.

Sometimes I am using Matlab to generate graphs and it works fine, except that the image is scaled in the sage notebook. If I open the file in the cell folder then I can see that it is scaled, at least when I compare the output from the exact same code evaluated directly in Matlab.

Is there some way to control scaling in sage?

EDIT: The problem is that the generated image from Matlab has a higher resolution than the image which is saved in the cell folder in the notebook. It seems as if the image is first saved somewhere else, then scaled, and then saved in the cell folder. So I am wondering if there is som global setting in sage which sets the scaling factor. Example:

#auto
%matlab
clear;clc;clf;
h1 = [0.25 0.25 0.25 0.25]; % for n = 0,1,2,3
h2 = [1 -1]; % for n = 0,1
t=0:1:204;
x = randn(1,200);
hfig=figure(1); clf
plot(x)
hold on
plot(conv(x,h1),'r')
axis([1 500 -5 5])
hold on
plot(conv(x,h2),'g')
axis([1 50 -5 5])
legend('x','conv(x,h1)','conv(x,h2)', 'Location','NorthEastOutside')
print -dpng image.png


This code saves the produced plot in the current folder directly.

I know this is matlab code and not sage, but the same code produces a larger image (higher resolution) when evaluated directly in matlab, than it does when evaluated in matlab from the sage notebook.