2022-06-22 11:10:58 +0200 | received badge | ● Famous Question (source) |
2016-12-30 16:41:26 +0200 | received badge | ● Notable Question (source) |
2016-12-30 16:41:26 +0200 | received badge | ● Popular Question (source) |
2015-07-22 06:09:08 +0200 | received badge | ● Famous Question (source) |
2014-08-01 10:23:08 +0200 | received badge | ● Famous Question (source) |
2014-06-29 03:15:04 +0200 | marked best answer | Overlaying plots in a specific order I've got two plots: one is a density plot, one is a list plot. I'd like to combine the plots in such a way that the list plot is overlaid on top of the density plot, so the dots or visible. No matter what I do, it seems that the density plot is always in front and list plot is in back. This isn't my code, but it appears to have the same behavior: How can I make the list plot on top (or in general, specify the order of any combined plots)? |
2014-06-29 03:14:59 +0200 | marked best answer | Plot doesn't seem to evaluate my function I've got a custom function I wrote and I'm trying to plot it. Actually, I'm trying to do an xy density plot but the density plot function was flat (all blue). So I'm trying to plot in a single variable to see what's going on, and the result is all zeroes. However, when I evaluate my function at several points, none of them are zero. Here's some code showing my function being evaluated at several points vs what plot gives me. Any idea what's going on? |
2013-11-15 05:10:48 +0200 | received badge | ● Famous Question (source) |
2013-11-03 08:54:40 +0200 | received badge | ● Nice Answer (source) |
2013-10-10 02:35:52 +0200 | received badge | ● Notable Question (source) |
2013-07-27 14:54:14 +0200 | received badge | ● Nice Question (source) |
2013-06-09 07:09:43 +0200 | received badge | ● Taxonomist |
2013-04-24 05:54:06 +0200 | received badge | ● Notable Question (source) |
2013-02-28 14:05:56 +0200 | received badge | ● Notable Question (source) |
2013-02-18 09:41:35 +0200 | received badge | ● Necromancer (source) |
2013-02-18 09:41:35 +0200 | received badge | ● Teacher (source) |
2012-12-27 18:16:55 +0200 | received badge | ● Popular Question (source) |
2012-11-23 05:40:37 +0200 | received badge | ● Popular Question (source) |
2012-11-06 16:50:22 +0200 | received badge | ● Popular Question (source) |
2012-01-16 15:56:17 +0200 | answered a question | suppressing output in notebook Another thing you can do is just put the keyword "None" as the last line in the cell. Example: |
2011-12-01 18:13:30 +0200 | commented answer | Is there a simple way to plot an image in a notebook? I.e. the output of the imshow function in matplotlib... Do these saved files ever get deleted once they are created? |
2011-12-01 18:13:30 +0200 | received badge | ● Commentator |
2011-12-01 16:29:33 +0200 | answered a question | Is there a simple way to plot an image in a notebook? I.e. the output of the imshow function in matplotlib... Do these saved files ever get deleted once they are created? |
2011-12-01 16:16:40 +0200 | commented answer | log base 10 If you could make this change it would be great: "EXAMPLES: sage: log(e^2)" : To something like: EXAMPLES: To change the base of the logarithm, add a second parameter. sage: log(1000,10): 3 Small change but helpful! |
2011-12-01 13:24:15 +0200 | marked best answer | log base 10 This is in So |
2011-12-01 13:23:51 +0200 | commented answer | log base 10 Thanks, I wasn't aware that log_b(x) was equivalent to log(x)/log(b). Might be good to add that to the docs. (I got hung up because I saw log(10)/log(2) in the log? documentation and assumed it meant that log(x,y) was something that didn't help me, because it didn't say "To use the log in base b, do this") |
2011-12-01 12:46:54 +0200 | asked a question | log base 10 Is there a built-in way to use a log with base other than e? The log documentation doesn't show any example (I thought log(10,x) was what I wanted for a while but it's actually different than what one might expect). |
2011-11-30 21:47:36 +0200 | commented question | Public interactive not working Good question, this would also be a highly useful feature for me as well. |
2011-11-30 16:21:24 +0200 | commented answer | Plot doesn't seem to evaluate my function Wouldn't it be possible to have an overloaded plot function that behaved differently depending on the input type? When it received a sage class input type it would behave one way, when it received a function input type it would behave another way. |
2011-11-28 16:03:40 +0200 | received badge | ● Student (source) |
2011-11-25 21:12:58 +0200 | marked best answer | Overlaying plots in a specific order You might be interested in the answers to this question about zordering.. You can choose how to zorder (i.e. choose the "depth" of an image) by calling set_zorder on the resulting graphics objects [not on the plots]. For example: But I have to admit that it doesn't look like all the objects you might want to support zordering the way they should: This is an inconvenience because it's not pretty to force it via the underlying matplotlib objects, but I might be missing something. |
2011-11-25 01:15:19 +0200 | marked best answer | Plot doesn't seem to evaluate my function The problem is how binding works in Python. sum_of_distances is a Python function, so it's evaluated immediately. So your plot command is really equivalent to And it so happens that: because this requires testing whether (e.g.) sqrt(x^2+9) < 30, which returns false because Sage doesn't know how to prove it's true (and it's not in general, as x is a symbolic variable which could be anything), so cumdist stays at 0. One way to get what you want is to use a lambda function to delay evaluation: (BTW, you might be interested in CartesianProduct and in generator expressions-- they can simplify some code like this.) |