Ask Your Question

holistone's profile - activity

2024-02-10 20:11:59 +0200 received badge  Popular Question (source)
2024-02-05 17:01:31 +0200 received badge  Notable Question (source)
2024-02-05 17:01:31 +0200 received badge  Popular Question (source)
2023-09-04 13:53:49 +0200 received badge  Popular Question (source)
2023-07-06 16:14:31 +0200 received badge  Popular Question (source)
2023-04-24 03:34:32 +0200 received badge  Famous Question (source)
2023-04-24 03:34:32 +0200 received badge  Notable Question (source)
2022-09-17 21:18:43 +0200 received badge  Popular Question (source)
2021-12-02 00:07:17 +0200 received badge  Enthusiast
2021-12-01 02:16:51 +0200 received badge  Self-Learner (source)
2021-11-30 19:32:22 +0200 edited answer How to eliminate URL text in conversion to pdf

The source of the problem is described by William Stein in CoCalc GitHub as the presence of the 3 lines a[href]:after

2021-11-30 19:31:41 +0200 answered a question How to eliminate URL text in conversion to pdf

The source of the problem is described by William Stein in CoCalc GitHub as the presence of the 3 lines a[href]:after

2021-11-29 23:27:26 +0200 received badge  Nice Question (source)
2021-11-29 17:30:34 +0200 commented question How to eliminate URL text in conversion to pdf

It's not just a CoCalc issue. I also have Sagemath 9.3 (latest for Win10) installed and create pdf from File/Print Previ

2021-11-29 05:46:25 +0200 edited question How to eliminate URL text in conversion to pdf

How to eliminate URL text in conversion to pdf I have a simple single Markdown cell in a standard Sagemath 9.4 notebook

2021-11-29 05:45:49 +0200 edited question How to eliminate URL text in conversion to pdf

How to eliminate URL text in conversion to pdf I have a simple single Markdown cell in a standard Sagemath 9.4 notebook

2021-11-29 03:37:07 +0200 asked a question How to eliminate URL text in conversion to pdf

How to eliminate URL text in conversion to pdf I have a simple simple Markdown cell in a standard Sagemath 9.4 notebook

2021-08-24 18:54:11 +0200 edited question raw cell format with Print or convert to html

raw cell format with Print or convert to html Is there a way to get the html version of a RAW cell to show the same as t

2021-08-24 04:08:15 +0200 asked a question raw cell format with Print or convert to html

raw cell format with Print or convert to html Is there a way to get the html version of a RAW cell to show the same as t

2021-08-01 06:48:25 +0200 received badge  Notable Question (source)
2021-04-09 14:59:22 +0200 received badge  Nice Answer (source)
2021-03-21 00:20:43 +0200 received badge  Self-Learner (source)
2021-03-21 00:20:43 +0200 received badge  Teacher (source)
2020-11-30 11:34:22 +0200 received badge  Good Question (source)
2020-11-30 10:46:42 +0200 received badge  Nice Question (source)
2020-11-29 19:56:09 +0200 asked a question How to eliminate truncated graph arrowheads?

The following simple directed graph has truncated arrowheads:

vpos = {'W':(-0.5,0.5),'E':(0.5,0.5),'mW':(-0.5,0),'mE':(0.5,0)}
D1 = DiGraph()
D1.add_edge(('mW','mE','mE-mW'))
D1.add_edge(('W','E','W-E'))
D1.add_edge(('mW','W'))
D1.show(pos=vpos,vertex_size=500,figsize=(2,2))

image description

If I change the last statement to:

D1.show(pos=vpos)

I still get truncated horizontal arrows, but less on the vertical. image description

Any suggestions for preserving full arrowheads? It looks like the clip limits for arrows are different than those for vertices. Setting fig_tight=False has no effect.

2020-11-19 18:13:47 +0200 received badge  Nice Question (source)
2020-11-19 17:13:55 +0200 commented answer Eliminate truncated graph display with large vertices

That works. The fig_tight argument was not in any of the Graph Plotting Options listed in the documentation. Can that be change? or a link added to other options?

I suspect the "tight" bounding box is computed based only on vertex centers, when it should include the vertex size. Even some of the vertices in the set_pos example figure in the documentation are top and bottom truncated. Can the bounding box calculation be updated?

Finally, what are the units for vertex_size (default 200) relative to vertex locations (typically in the range -1.0 - 1.0)?

2020-11-19 06:04:49 +0200 asked a question Eliminate truncated graph display with large vertices

When I increase the vertex size (to allow more room for labels) on Graph plots, the boundary vertices are trimmed. Here's an example:

Kms = [(3, 4, 2), (3, 7, 5)]
T = Graph()
T.add_edges(Kms)
T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5))
T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800)

image description

Changing figsize does not solve the problem. How do increase the trim limits so that everything drawn is shown?

2020-11-19 01:32:52 +0200 answered a question How can I add arbitrary text to a Graph object

Thanks to rburing (above) here's a successful example of adding multiple text objects in different colors to a graph: image description

2020-11-18 23:19:02 +0200 received badge  Commentator
2020-11-18 23:19:02 +0200 commented answer How can I add arbitrary text to a Graph object

This works with G.plot() instead of G.show(), and answers my question. Thanks.

2020-11-18 23:15:44 +0200 commented question How can I add arbitrary text to a Graph object

The mode would still show as a node with the same format that the other nodes.

2020-11-18 21:38:30 +0200 commented question How can I add arbitrary text to a Graph object

Thanks, that's a good pointer. The "title" and title_pos" options allows me to add a single text label. But what if I would like multiple text options? Although .show() recognizes "show legend", Graph does not accept "legend_label". I would expect that there is a general way of adding multiple text to a Graph such as D += text("hello world",(1,1))

2020-11-18 20:11:31 +0200 asked a question How can I add arbitrary text to a Graph object

I have created a Graph image such as shown below

image description

using the commands:

D = Graph(E)
D.show(pos=posd,**GPopt)

I would like to add text or a legend (explaining the colors) to the graph, but I have not found a way to add additional text to the Graph object. Suggestions welcome.

2020-10-14 03:09:36 +0200 received badge  Popular Question (source)
2020-02-05 21:51:58 +0200 commented answer Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

If Sagemath provides the Jupyter notebook for CoCalc is it possible for them to provide the SAME Jupyter notebook with their binary downloads for windows and other platforms?

2020-02-05 20:16:05 +0200 received badge  Nice Question (source)
2020-02-05 20:14:34 +0200 commented answer Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

If that's the case, how does it work in the Cocalc.com Sagemath 9.0 version?

Also, if a "single-character bug" I would have expected the bold to terminated by the *'s at the start of "Extended" rather that at the *'s at the end.

2020-02-05 18:34:42 +0200 asked a question Sagemath 9.0 Markdown inconsistency Cocalc vs. Local

I have recently installed the latest Sagemath 9.0 on a Windows 10 machine and noticed a Markdown bold formatting problem that is not present on the Cocalc.com Sagemath 9.0 version. Here is the Markdown:

For each of the 10 questions a student can choose 1 of **3** possibilities: (1) answer T, (2) answer F, or (3) omit. By the **Extended Rule of Products**, there are $3^{10}$ ways of accomplishing this, this is far more than $2^{10}$.

On the local 9.0 install it renders as:

image description

Notice that the bold is not terminated by the ** after the '3'. On the other hand, the same code on Cocalc.com renders correctly with Sagemath 9.0:

image description

Both of these use the latest Chrome browser. Is there any way to correct the Markdown rendering on the local install?

If Sagemath provides the Jupyter notebook for CoCalc is it possible for them to provide the SAME Jupyter notebook with their binary downloads for windows and other platforms? Or just update the Jupyter notebook part of the Sagemath 9.0 Windows executable?

2019-11-15 16:25:35 +0200 marked best answer incorrect plot of simple defined function, but works with lambda

I am trying to produce a plot of a simple defined function with a single if statement. The function works correctly as demonstrated by numerical values, but the corresponding plot is incorrect.

If I create the plot using a lambda definition of the function, the plot is correct. The sample code follows:

def h(x):
    if x<0: return x
    return x^2
for k in (-2..2): 
    print "(%d,%d)"% (k,h(k)),
print 'sample h(x) vs. x pairs'
H = plot(h(x),(-1.5,1.5),linestyle='dotted',color='red',thickness=3)
L = plot(lambda x: x if x<0 else x^2,(-1.5,1.5),figsize=3)
H+L

The following image shows the code and output in a Sagemath notebook. As you can see the plot of h(x) does not properly evaluate the function if statement, but the lambda plot does. image description

2019-11-15 15:27:15 +0200 commented answer incorrect plot of simple defined function, but works with lambda

Interesting. Is there a list of the "classic Sage traps"?

Coming from python, I would have expected some form of error message. Especially since the symbolic evaluation of h(x) as x^2 is not really correct.

If I change the definition to

def h(x):
    return x^2*(x>=0)+x*(x<0)

which returns the same values, I now get an error with

print h(x)

and this is what I would have expected with the original definition of h(x).