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.Fri, 12 Jul 2019 05:59:10 -0500How to change the unreadable dark blue colour in the SageMath command line window under Windows-10?http://ask.sagemath.org/question/47136/how-to-change-the-unreadable-dark-blue-colour-in-the-sagemath-command-line-window-under-windows-10/ I have just installed SageMath 8.7 on my Windows-10 laptop and want to learn it. The font colour of the prompt and of the typed numbers is dark blue on the black background, totally unreadable. Google search delivers tons of such complaints about bash/pythin/mintty/cygwin command lines. All suggest to edit some configuration files, which are hardly possible to locate in SageMath, neither in the SageMath installation directory, nor in my user home directory. There is a file ".sage\profile_default\ipython_config.py" in my Windows home, containing the line
c.TerminalInteractiveShell.colors = 'Linux'
Changing this line has no effect.SevasFri, 12 Jul 2019 05:59:10 -0500http://ask.sagemath.org/question/47136/tweak markdown editing fonthttp://ask.sagemath.org/question/35792/tweak-markdown-editing-font/ Hi, is it possible to tweak the markdown editing font to something not monofont? I prefer monofont for writing code, but the markdown window could use a different font. Is this something I can tweak myself? thweeTue, 29 Nov 2016 12:47:11 -0600http://ask.sagemath.org/question/35792/How to include PDF image from Sage into LaTeX document (scale issue)?http://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 -0500http://ask.sagemath.org/question/34877/previous fontsize settings in plot now produce huge fontshttp://ask.sagemath.org/question/29464/previous-fontsize-settings-in-plot-now-produce-huge-fonts/I have been using p.fontsize(20) a lot, but since the upgrade to 6.8, the same setting now produces HUGE font sizes, making the axes labels exceed the figure sizes. I wonder what happened there and how this could be fixed.
I believe that some of the reason is the introduction of the new option axes_labels_size as mentioned here:
http://ask.sagemath.org/question/26807/how-do-i-adjust-the-size-of-axes-labels-and-figure-titles-in-plots/
Try this in a sage version before 6.7 and after 6.7:
P = plot(x^2, 0,2)
P.axes_labels(['Some value of x', 'Resulting value of y'])
P.fontsize(20)
P
Is there a way to put a one-liner at the start of my worksheets to get back the old behaviour without having to modify all P.fontsize(20) lines?
stanWed, 16 Sep 2015 07:57:35 -0500http://ask.sagemath.org/question/29464/xkcd and matplotlibhttp://ask.sagemath.org/question/11366/xkcd-and-matplotlib/<p>Hi guys. Attempting to use the xkcd graphics feature that has been recently added to matplotlib from within sagemath.</p>
<p>import matplotlib.pyplot<br>
matplotlib.pyplot.xkcd()<br>
plot(sin(x),(x,-pi,pi),ticks=pi/4,tick_formatter=pi)</p>
<p>Matplotlib throws the following warning: </p>
<p><i>/home/joal/bin/sage-6.2/local/lib/python2.7/site-packages/matplotlib-1.3\
.1-py2.7-linux-x86_64.egg/matplotlib/font_manager.py:1236: UserWarning:
findfont: Font family ['Humor Sans', 'Comic Sans MS'] not found. Falling
back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext])) </i></p>
I have installed Humor Sans.ttf onto the main system, and into the directory: <br>
<i>/home/joal/bin/sage-6.2/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/mpl-data/fonts/</i>
... but don't know how to reset the matplotlib font cache so matplotlib will pay attention to the new font.
----------
[EDIT]
<p>Okay, seem to have part of the solution - need to verify on a Linux machine this weekend.</p>
<p>EDIT of EDIT<br>
The tricks below don't work on LinuxMint.</p>
<p>The font is recognised in the virtualbox image if it is dumped into:<br>
<i>sage-6.2/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/mpl-data/fonts/</i><br>
and renamed <i>Humor-Sans.ttf</i></p>
<p>Then you need to create a .matplotlib folder in the user directory.<br>
<i>mkdir ~/.matplotlib</i></p>
<p>The concern is that it now that Humor Sans is used for text font, but not for the numbers on the horizontal and vertical axes. Any suggestions, sagers?</p>
----------
[EDIT]
<p>Which turns out to be a consequence of using the pi tick_formatter.</p>JoalHeagneyMon, 12 May 2014 22:56:43 -0500http://ask.sagemath.org/question/11366/Sage unable to find font on my machine.http://ask.sagemath.org/question/11351/sage-unable-to-find-font-on-my-machine/I was trying to change the font on a plot to Computer Modern Roman. Is there a way I can install the fonts in sage itself so that sage does not have to look all over the disk for the right font. Here is the code for the plot
from matplotlib import rc, rcParams
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
#plt.rc('text', usetex=True)
plt.rc('font',**{'family':'serif','serif':['Computer Modern Roman'],'size':12})
fig = plt.figure(figsize=(4.0,2.8))
ax = fig.add_subplot(111)
plt.ylim(0,20)
plt.xlim(0,20)
a=[0,10,20]
b=[0,10,20]
p1=plt.plot(a, b,'r--')
plt.savefig('test.png')
I get the message
"/Users/shashank/sage/local/lib/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['serif'] not found. Falling back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext]))".
Has anyone else encountered this issue and how does one fix it. I am using a Mac if that helps.
Also uncommenting usetex=true leads to the following error, I have installed the latest version of freetype from port on mac.
dyld: Library not loaded: /opt/local/lib/libfreetype.6.dylib
Referenced from: /opt/local/lib/libpoppler.44.dylib
Reason: Incompatible library version: libpoppler.44.dylib requires version 18.0.0 or later, but libfreetype.6.dylib provides version 10.0.0
sh: line 1: 2899 Trace/BPT trap: 5 latex -interaction=nonstopmode 342a49751566a29dab1cfcec0a04bf79.tex > "/Users/shashank/.sage//matplotlib-1.2.1/tex.cache/342a49751566a29dab1cfcec0a04bf79.output"ShashankThu, 10 Apr 2014 11:16:09 -0500http://ask.sagemath.org/question/11351/font_family for text()http://ask.sagemath.org/question/9201/font_family-for-text/Hello!
Is the *'font_family'* option available for something other than a pot legend? In particular, I need to set the font face for the text added to a plot with the *text()* function.
Thanks!v_2eFri, 03 Aug 2012 03:14:16 -0500http://ask.sagemath.org/question/9201/change legend font when plottinghttp://ask.sagemath.org/question/8882/change-legend-font-when-plotting/I would like to ask are there any ways to change the font of the legend? I searched the document and only found the option "legend_font_family", which can be sans-serif, serif or other name. However, I don't want to use the default font defined in system.lainmeThu, 12 Apr 2012 19:02:39 -0500http://ask.sagemath.org/question/8882/Notebook font settings?http://ask.sagemath.org/question/8611/notebook-font-settings/Is there any way to change the default set of fonts used in notebook? For interface, code editor and text output?EugeneFri, 06 Jan 2012 21:05:17 -0600http://ask.sagemath.org/question/8611/line3d fonsize option?http://ask.sagemath.org/question/8607/line3d-fonsize-option/Hi!
I need to hide exact values in 3d plot. In case of 2d I can use fontsize option like:
line([(0,0),(1,1)]).show(fontsize=0)
But show + line3d ignores fontsize option.EugeneWed, 04 Jan 2012 09:15:09 -0600http://ask.sagemath.org/question/8607/font size in matplotlibhttp://ask.sagemath.org/question/8520/font-size-in-matplotlib/ Hello!
Could somebody please help me find a way to change the font size in Matplotlib plots. Particularly, I would like to change the size of the axis ticks labels.
Thank you.
vladimirv_2eMon, 05 Dec 2011 01:00:49 -0600http://ask.sagemath.org/question/8520/