ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 13 Feb 2018 22:03:13 -0600implicit plot with different scales on x and y axeshttp://ask.sagemath.org/question/41110/implicit-plot-with-different-scales-on-x-and-y-axes/ Say I want to plot `implicit_plot(x^2 + 10000*y^2 - 2, (x,-3,3), (y,-0.03,0.03))`, or anything else where the interesting values of x and y varies over different orders of magnitude. At least on my machine, the result is a completely illegible png, squished into nothingness.
http: // i187.photobucket.com/albums/x207/pratarpersilja/scaling_unusable_zpsspbvecof.png
(I wasn't allowed to add clickable links).
Of course, in this particular case I could rewrite the expression manually until the x and y ranges are the same. In the case that inspired these experiments in the first place, that rewrite is not realistic to do by hand.
How do I force an implicit plot to not have the same number of pixels per numerical unit in x and y directions?pratarpersiljaTue, 13 Feb 2018 22:03:13 -0600http://ask.sagemath.org/question/41110/What are my best options for taking advantage of multiple cores?http://ask.sagemath.org/question/7578/what-are-my-best-options-for-taking-advantage-of-multiple-cores/What are my best options for taking advantage of multiple cores?
For the pure python case?
For working with sets of particular libraries which sage interfaces?
Note: Apple just started offering 12-core mac-pros (24 virtual cpus with hyper-threading). Since the transistors are getting about as small as they can, parallel computing is impacting the entire technology stack. Please note I'm not asking how to categorize algorithms, I'm aware that some naturally parallelize better than others. This is a recipes/examples question.
Does Sage already comprehensively address this, and if not, does the Sage roadmap address it?ccanoncWed, 18 Aug 2010 18:06:30 -0500http://ask.sagemath.org/question/7578/Scale to simple integershttp://ask.sagemath.org/question/26098/scale-to-simple-integers/There are many situations where multiplying an object by a scalar doesn't change its relevant properties. For example a polynomial, when all you care about are its roots. Or a matrix, when you onyl care about the kernel. Or a vector or matrix when you are dealing with homogeneous coordinates. Often it would be nice if we could choose a factor which leads to a particularly simple representation of all the objects involved. If all numbers involved are rational, we'd scale to make them integers. Then we could compute their gcd and divide by that, to obtain small integers. We might even fix the sign in some way, e.g. require the leading term of a polynomial to be positive.
Things become interesting if we nest things. If we have a matrix over the fraction field over some stack of nested polynomials, with rationals as the field underlying all of this, then we would have to traverse several layers of data structures to find all the numbers and turn them into integers. And along the way we'd multiply with the denominators from the polynomial fraction field as well.
**Is there any functionaliy in Sage to provide any of this? Perhaps not all the way to what I described, but at least part of it?**
I know there is a method `monic` both for vectors and for polynomials, to obtain a representation which is normalized in a certain sense. But that's not the sense I'm after since it usually leads to fractions. I also know that there are classes to represent [projective spaces](http://sagemath.org/doc/reference/schemes/sage/schemes/projective/projective_space.html) over arbitrary rings, and a [method to clear denominators](http://sagemath.org/doc/reference/schemes/sage/schemes/projective/projective_point.html#sage.schemes.projective.projective_point.SchemeMorphism_point_projective_field.clear_denominators) for points of such a space. But since I can't operate on such projective points using standard linear algebra matrices, and since converting between both worlds is tedious, I don't use these classes at all even though I use homogeneous coordinates all the time.
I'm tempted to write a trac ticket to request functionality along these lines (and perhaps write some of it myself later on), but I first wanted to know whether I had overlooked something like this.MvGMon, 09 Mar 2015 11:50:35 -0500http://ask.sagemath.org/question/26098/Scaling of png from Matlabhttp://ask.sagemath.org/question/8040/scaling-of-png-from-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.
Maybe I am mistaking about this, but these are the "symptoms" I'm experiencing here. KabiWed, 30 Mar 2011 23:06:22 -0500http://ask.sagemath.org/question/8040/