Ask Your Question

PatB's profile - activity

2020-12-26 07:08:13 +0200 received badge  Teacher (source)
2020-12-26 07:08:13 +0200 received badge  Self-Learner (source)
2020-12-26 05:27:06 +0200 received badge  Editor
2020-12-26 05:24:45 +0200 answered a question Combined 2d plot: how to change the size of the object?

Yes, that makes perfect sense!

I need to create a reference to this combined object - as you suggested mQ = m+Q allows me to do mQ.set_axes_range(...)

Merci Beaucoup! Une réponse le jour même de Noël!

2020-12-25 21:31:32 +0200 asked a question Combined 2d plot: how to change the size of the object?

I have created a matrix plot and a line and combined them as follows:

m = matrix_plot([[1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0]],
                aspect_ratio=1,
                frame=False)
Q = line([(-0.5, 0), (1, 1)], thickness=3)

Combined graphics is (m+Q).

I would like to change the size of (m+Q), but (m+Q).set_axes_range() does not affect the values.

Here is an example showing no change when using set_axes_range():

What method should I use?

2020-12-05 05:43:20 +0200 asked a question How to show lines and images on a chess board (matrix_plot)

Hi, I naively created a chess board with a matrix_plot.

m = matrix_plot([[1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0],
                 [0,1,0,1,0,1,0,1],
                 [1,0,1,0,1,0,1,0]]
                  )

Shown alone, it looks almost like a chess board, but it has axes and white padding on the periphery

 (m).show(aspect_ratio=1)

I then naively tried to add a line to that plot -

Q = line([(-0.5,0),(1,1)])
(m+Q).show()

Somehow I have lost the whole matrix plot . This is version 8.7 in a jupyter notebook

Q = line([(-0.5,0),(1,1)])
(m+Q).show()

i only get 2 rows - the rest is truncated.

Question - how to graph lines on top of this matrix plot without truncating the apprearance?

Merci! Pat

2020-08-02 17:43:26 +0200 received badge  Famous Question (source)
2020-04-29 18:49:42 +0200 received badge  Famous Question (source)
2019-10-16 21:38:26 +0200 asked a question Looking for musical exercises using sage

Hi Folks,

Has anyone tried to do some harmonic or rythm analysis for musical instruments using sage?

Also - how easy is it under ubuntu to produce sounds of these harmonics?

Any links will be appreciated.

thanks Pat

2019-10-16 21:35:42 +0200 answered a question How to remove PID of defunct notebook server?

Hi folks,

I tried running notebook(require_login=False) .... which produced an error and probably as a side-effect deleted the "lock" file I was looking for with the defunct pid.

Then I restarted the notebook() and it works... The terminal message told me: Executing twistd --pidfile="sage_notebook.sagenb/sagenb.pid" -ny "sage_notebook.sagenb/twistedconf.tac"

I then checked :~/.sage/sage_notebook.sagenb for sagenb.pid .... this file contained 3800 --- which is the currently running server.

So I suspect that if I get this problem again, alls I need to do is delete this "lock" file.

Eh bien!

Pat

2019-10-16 18:31:47 +0200 asked a question How to remove PID of defunct notebook server?

Hi Sage users

It looks like a system crash left a lock file for a sage notebook server. I cannot run the notebook: Another Sage Notebook server is running, PID 2128. Opening web browser at http://localhost:8080/ ...

Does anyone know where this lock file is or what the procedure is to clear up this error? I have no PID 2128 running at the time this error occurs. Hence I think it is some lock file or ressource that needs to be freed or deleted. Thanks Pat

2019-10-16 18:28:08 +0200 received badge  Popular Question (source)
2019-02-27 18:38:44 +0200 received badge  Commentator
2019-02-27 18:38:44 +0200 commented answer Looking for stellation of polyhedra

Hi Thanks for getting back to me. I'm looking to create various nets of stellations of the icosahedron as shown here for example: https://en.wikipedia.org/wiki/Stellat... I discovered this in Wenninger's book Polyhedron Models - number 27 shows the Second Stellation of the icosahedron - very beautiful. Mathworld shows the first stellated form of the isocasehdron the Triakis Icosahedron and provides a net for it http://mathworld.wolfram.com/TriakisI.... Can we do that in sage? Pat

2019-02-04 03:41:09 +0200 received badge  Famous Question (source)
2019-02-04 03:41:09 +0200 received badge  Notable Question (source)
2019-02-04 03:41:09 +0200 received badge  Popular Question (source)
2019-02-03 22:20:24 +0200 received badge  Nice Question (source)
2019-02-03 18:45:06 +0200 asked a question Looking for stellation of polyhedra

Hi Sagists, I'm wondering if anyone knows a way to do stellation with the Polyhedron class? Mathematica has a Stellate function but they admit it is really an augment operation and not a true stellation thanks Pat Browne

2018-11-17 20:26:25 +0200 asked a question integration - StopIntegration support?

Is there a way to specify a stopping rule or condition like r[t] < rMin when integrating?

Here's an example in Mathematica:

s = NDSolve[{r''[t] == -GM / r[t]^2, r[0] = 1000 * s0, r'[0] = 0,
             WhenEvent[r[t] < rMin, "**StopIntegration**"]}, r, {t, 0, 86400 * 100}]
2017-10-09 17:42:50 +0200 received badge  Nice Question (source)
2017-10-05 22:01:53 +0200 asked a question how to get more information on graphics object

Hi, I'm plotting arcs, and they're not doing what I want. When I try to examine them the information is hidden behind the message Graphics object consisting of 1 primitive. How do I find out what the arc object contains?

thanks ./pat

2017-02-10 17:20:30 +0200 received badge  Student (source)
2017-02-10 17:20:25 +0200 received badge  Notable Question (source)
2016-02-15 20:15:32 +0200 received badge  Notable Question (source)
2016-02-04 20:58:05 +0200 received badge  Popular Question (source)
2015-07-22 17:06:55 +0200 received badge  Popular Question (source)
2012-12-13 00:38:11 +0200 commented question Plotting and the show() method

Hi Folks, I'm curious - I could help do the documentation patch - but not sure if I'm allowed. Once that is done, I'd be happy to "Answer my own question" by citing the documentation, and then we could say the case is closed... So how can I help?

2012-12-10 23:12:15 +0200 commented question Plotting and the show() method

Hi kcrisman I think I have concluded the same thing. Interactive behaviour shows the plot without calling method .show() . This is similar to python interactive behaviour : the interactive python window prints evaluations such as 3**7 as 2187 without the user calling method print(). Do we have consensus: Not a bug? If so, then perhaps we should hint in the documentation that the programmer must call the show() method for plot functions like list_plot... (speaking as a newbie)

2012-12-10 22:02:49 +0200 commented question Plotting and the show() method

Hi ppurka Both the notebook launch and the cli launch of the script from sage produce the no-show problem. If I do list_plot outside of the script I have no no-show problem

2012-12-10 11:33:05 +0200 commented question Plotting and the show() method

Hi Ppurka It seems I cannot use pdb to step through the code? In that case, I will use the binary search method as you suggested to probe when list_plot() needs a show() to produce a plot. The problem may be difficult to find if list_plot from the very beginning of the script requires show()... we'll see... (I'll keep us all posted...) ... thanks for your support!

2012-12-09 17:39:12 +0200 commented question Plotting and the show() method

Ok, here is the code that requires the .show() This is an extract from the plot() method: The commented lines do not have the show() and do not plot. list_plot(self.m,axes = 'true',aspect_ratio='automatic').show() #list_plot(self.m,axes = 'true',aspect_ratio='automatic') list_plot(self.ellipse,axes='true',aspect_ratio='automatic').show() #list_plot(self.ellipse,axes='true',aspect_ratio='automatic')

2012-12-09 17:11:22 +0200 commented question Plotting and the show() method

Hi Calc314 and ppurka, I tried the list_plot experiement as follows: ---------------------------------------------------------------------- | Sage Version 5.0.1, Release Date: 2012-06-10 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: list_plot([[1,2],[2,3],[3,4]]) sage: help(list_plot) sage: list_plot([[1,2],[2,3],[3,4]]) In both cases, the plot was produced. This was on a 'cold start' of sage. The problem seems to occur if I load a script because the show was seen to be necessary in the code..

2012-12-08 23:19:33 +0200 commented question Plotting and the show() method

Hi ppurka, 1. The exact command is as follows: list_plot(self.ellipse,axes='true',aspect_ratio='automatic').show() where self.ellipse slice as follows: [[-0.2502810527046193, -0.9528485681543885], [-0.23332252056744662, -0.9570135783421186], [-0.2162905291096238, -0.9608821121646137], [-0.19918932688797977, -0.9644526012140253]...etc] (Note: This is the snippet of source code which requires the show() command.) 1a. I just tested the same source code in the notebook, and the show() is also needed. Omitting the show() and no-show of the ellipse (: 2. show_default() is True When set to False and show() not called, there is no text output of the Graphic i.e. same behaviour as when set to True - need show() 3. My version of sage: Sage Version 5.0.1, Release Date: 2012-06-10 tx!