ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 May 2017 08:40:06 -0500Scale axis width=1 and height=1https://ask.sagemath.org/question/37631/scale-axis-width1-and-height1/Hello,
I would like to scale the y-axis or the x-axis, so that the grid consists of squares with width=1 and also height=1. Because if i draw elliptic curves, it will deform them.
Thank you very much!
Edit: apparently the code is
p3=plot(EllipticCurve([0,0,0,-3.141592654,1.414213562]), color='black', gridlines='true')
show(p3)
p3.axes_labels(['x','y'])
p3.save('ec1.pdf')test1234Fri, 19 May 2017 08:40:06 -0500https://ask.sagemath.org/question/37631/How to include PDF image from Sage into LaTeX document (scale issue)?https://ask.sagemath.org/question/34877/how-to-include-pdf-image-from-sage-into-latex-document-scale-issue/Hello!
I have a PDF illustration prepared in Sage:
p = plot(sin, 0, pi, fontsize=12, axes_labels=('ABCDE', ur'$ABCDE$'))
p.save('/tmp/sage1.pdf')
And the following LaTeX document:
\documentclass[12pt]{article}
\usepackage{graphicx}
\graphicspath{{/}}
\begin{document}
ABCDE $ABCDE$ \\
\includegraphics{sage1.pdf}
\end{document}
The problem is that the font size is inconsistent - is is clearly bigger in the picture than in document. I know about width parameter for includegraphics and other scaling option, but how to select the scale? Or, more generally, how to include PDF graphics to get exactly the same font size?
![font size issue](/upfiles/14744573018217295.png)EugeneWed, 21 Sep 2016 06:29:56 -0500https://ask.sagemath.org/question/34877/Log scale in vector fieldhttps://ask.sagemath.org/question/33889/log-scale-in-vector-field/Is there a way to plot a 2D vector field with log scale in the x-axix? I was using plot_vector_field, but I can't find a way to use log with that.vitorWed, 22 Jun 2016 20:36:07 -0500https://ask.sagemath.org/question/33889/Scale to simple integershttps://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 -0500https://ask.sagemath.org/question/26098/How can I determine or control a plot's display scale?https://ask.sagemath.org/question/10722/how-can-i-determine-or-control-a-plots-display-scale/Suppose I do something like
p = plot(sin(x), (x,0,2*pi))
p.save("/tmp/plot.png")
Is there some way of knowing (or even better, controlling) *exactly* the scale of the saved image in pixels per axis unit (in each direction)?
For example, if I wish to write a second graph to a different png file at exactly the same scale, is there some way to do this?
Or, to put it differently, instead of specifying the size of the output png file in inches using `figsize`, I wish to specify the size in inches (or pixels) *per graph unit*.
[This matplotlib tutorial](http://matplotlib.org/users/transforms_tutorial.html) seems to be about what interests me, but I don't understand how Sage relates to matplotlib, and how I can access the `transData` field, let alone control its value.Gro-TsenSun, 10 Nov 2013 12:19:13 -0600https://ask.sagemath.org/question/10722/Deriving Data and Plottinghttps://ask.sagemath.org/question/9236/deriving-data-and-plotting/In the following x means multiply.
Let
z1=2 x pi x 650 x 10^6
p1=2 x pi x 1.9 x 10^9
p2=2 x pi x 5 x 10^9
adc=.667
deltaF=.2 x 10^9
In the following j is the imaginary representation
Now let `N=(adc x p1 x p2)/z1` and
M=(-2 x j x pi x freq x z1)/((-2 x j x pi x freq+p1) x (-2 x j x pi x freq+p2))
The base formula is abs(20 x log(N x M,10)) or the absolute value of 20 log(N x M) where the log base is base 10. Within the base formula is *freq* (the value of the frequency) which will be swept from 10^8 to 10^11 in steps of deltaF (.2 x 10^9)
The vertical range is from -25 to 5 (linear scale) and the horizontal range is from 10^8 to 10^11 (log scale)
The horizontal axis as stated is a **Log** scale as opposed to Linear.
How do I set this up in Sage to plot per the above? Thanks.
gjmTue, 14 Aug 2012 09:15:56 -0500https://ask.sagemath.org/question/9236/