ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Jan 2024 11:09:24 +0100Draw a list of continuously colored pointshttps://ask.sagemath.org/question/75651/draw-a-list-of-continuously-colored-points/I have a list of point and use list_point to draw it. Let’s say
L=[[k,sqrt(k)] for k in range (1000)]
list_plot(L)
I'd like to color the points in a continuous way, to remember the order in which they were drawn. Let's say from the black for the first point on the list to the red for the last.
How can I achieve my goal?EmmThu, 25 Jan 2024 11:09:24 +0100https://ask.sagemath.org/question/75651/How to create curved, directed, and labelled edges of a graphhttps://ask.sagemath.org/question/26823/how-to-create-curved-directed-and-labelled-edges-of-a-graph/ I am using the graph_editor() to create a graph in the SageMath notebook. This is good but it does not allow me to create a curved edge, directed edge or a labelled edge. Does anyone know how to do this in SageMath? Thank you for your help.cheboluThu, 14 May 2015 03:21:14 +0200https://ask.sagemath.org/question/26823/Draw a 2D spatial networkhttps://ask.sagemath.org/question/23623/draw-a-2d-spatial-network/ Hi experts!
I have:
* a list of Q 'NODES'=[(x,y)_1,........, (x,y)_Q], where each element (x,y) represent the spatial position of the node in 2D Cartesian space.
* a matrix 'H' with QxQ elements {H_k,l}.
H_k,l=0 if nodes 'k' and 'l' aren't joined by a edge, and H_k,l = the length of the edge that connects these nodes.
* a matrix 'Z' with QxQ elements {Z_k,l}.
Z_k,l=0 if nodes 'k' and 'l' aren't joined by a edge, and Z_k,l = intensity_k,l (a intensity scale of the edge)
I want to draw the nodes in their spatial position, connected by the edges, and use a color scale for the 'intensity'.
How must I do that?
Waiting for your answers.
Thanks a lot!
Best regards,
José LuismresimulatorTue, 29 Jul 2014 14:21:54 +0200https://ask.sagemath.org/question/23623/plt.show() and plt.draw() doesnt workhttps://ask.sagemath.org/question/23387/pltshow-and-pltdraw-doesnt-work/Hi experts!
I have a numpy array M. I generate a graph using NetworkX and then I want to draw this graph:
import networkx as nx
import matplotlib.pyplot as plt
G=nx.Graph(M)
nx.draw(G)
plt.draw()
Doing this, no picture appears. In addition, if I do `plt.show()` no picture appears neither.
If I do
import numpy as np
import matplotlib.pyplot as plt
x = np.range(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)
no picture appears neither.
What happend?
Please help!
Best regardsmresimulatorSat, 12 Jul 2014 18:52:36 +0200https://ask.sagemath.org/question/23387/Drawing a graph - fixing its layouthttps://ask.sagemath.org/question/10675/drawing-a-graph-fixing-its-layout/Hello!
I would like to draw a simple graph $G$ and its complement $\overline{G}.$ I was asked to make the drawing such that it is evident that the drawings are complementary. More precisely I was advised to draw $G$ and $\overline{G}$ such that the coordinates of the vertices of $G$ are the same as the one for $\overline{G}.$
What would be an easy way to accomplish this in Sage?
Thank youJernejWed, 30 Oct 2013 12:29:11 +0100https://ask.sagemath.org/question/10675/