2020-09-28 14:57:37 +0100 | commented answer | Using base 10 exponent of a number as label in a contour plot Thank you, also for picking up the possible "0" issue. I just had to import log10 from numpy to avoid some type errors when I introduced this into the contour_plot. |

2020-09-28 14:56:33 +0100 | received badge | ● Scholar (source) |

2020-09-28 12:19:09 +0100 | received badge | ● Student (source) |

2020-09-28 11:54:34 +0100 | asked a question | Using base 10 exponent of a number as label in a contour plot I am currently trying to improve the labelling of a contour plot. As contours I'm only using negative powers of ten, so I hope to have a simple LaTeX label of the form, say, 10^{-23}. My starting point was one of the examples at the help page for contour_plot (here was the link to the sage documentation). After various failed attempts with log(x, 10), I found in the question "Integer types and log()" (that would be question id(?) 28679/integer-types-and-log) an example using valuation(x,10). However, the results seem odd. Below the slightly simplified thing I try to plot. If I do this, I get 10^{-0} for several contours. So, I checked, what valuation does to the numbers: yielding If I'm using something like instead, I get only the message "Graphics object consisting of 1 graphics primitive", and yields another plot with odd labels - which have the odd behaviour at the same exponents as the example with "valuation", but I don't know why. I'm currently doing this mostly in a jupyter notebook on Windows 10 with Sage 9.1. Am I misunderstanding the use of "valuation" or log(x,10) in this case? Did I run into a bug? How can I get the exponents I'm after? |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.