Ask Your Question

Garald's profile - activity

2024-03-02 08:58:35 +0200 received badge  Notable Question (source)
2023-09-21 17:02:01 +0200 received badge  Popular Question (source)
2023-09-19 20:15:01 +0200 commented answer How to plot the real line in SageMath

My question is really about reproducing tikz effects in native Sage code, but I am getting the message that doing so is

2023-09-19 20:14:42 +0200 commented answer How to plot the real line in SageMath

Right, my question is really about reproducing tikz effects in native Sage code, but I am getting the message that doing

2023-09-19 14:47:22 +0200 commented answer How to plot the real line in SageMath

Right, but wouldn't it be nice if one could embed tikz in Sage, much as one can embed Sage in a LaTeX document...

2023-09-19 14:45:37 +0200 edited question How to plot the real line in SageMath

How to plot the real line in SageMath I am preparing a SageMath Jupyter notebook for expository purposes. I would like t

2023-09-19 14:45:17 +0200 edited question How to plot the real line in SageMath

How to plot the real line in SageMath I am preparing a SageMath Jupyter notebook for expository purposes. I would like t

2023-09-19 14:39:32 +0200 edited question How to plot the real line in SageMath

How to plot the real line in SageMath I am preparing a SageMath Jupyter notebook for expository purposes. I would like t

2023-09-18 09:36:24 +0200 commented answer How to plot the real line in SageMath

1D, really! As I said, I could hack the 2D plotter to do this, but there has to be a better way. It's the sort of thing

2023-09-18 09:21:57 +0200 marked best answer How to plot the real line in SageMath

I am preparing a SageMath Jupyter notebook for expository purposes. I would like to be able to display the real line, with chosen points on it, and some arrows between certain pairs of points.

While this would be easy to do in LaTeX (by means of TikZ), I do not know how to do it in Sage. This feels like something that should be well within Sage's capabilities. What to do?

Let me give an easy, concrete example. Say I want to plot the points -5/11 + \beta, -4/11 + \beta,..., 5/11+\beta (labelled as such) on the real line, where $\beta = 1/50$ (for instance).

In a second version of the graph, I also want curved arrows going from -5/11+\beta to -4/11+\beta, from -4/11+\beta to -3/11+\beta, and so on until -2/11+\beta to -1+\beta; I also want a curved arrow from -1+\beta to 0.

How to do this?

Update: Let me include some (extremely amateurish) TikZ code, so that people can see exactly what I want:

\begin{tikzpicture}
\def\scale{2}
\def\bet{0.2}
\draw[-] (-\scale*3.5,0) -- (\scale*3.5,0); 
\foreach \i in {-3,...,3} {
  \draw[shift={(\scale*\i,0)},color=gray] (0pt,0pt) -- (0pt,-3pt) node[below] {$\frac{\i}{q}$};
  \filldraw (\scale*\i+\scale*\bet,0) circle (2pt) node[above] {$\frac{\i}{q}+\beta$};
}
\foreach \i in {-3,...,-2} {
  \draw[*->*] (\scale*\i+\scale*\bet-0.08,0.04) to[bend right] (\scale*\i+\scale*\bet+\scale+0.08,0.04);
}
\draw[*->] (-\scale+\scale*\bet-0.08,0.04) to[bend right] (0,0);
\end{tikzpicture}

I'd gladly include the result here, but I do not yet have enough points to upload files :(.

Of course I can just include the resulting image in my Jupyter notebook, but for some reason Jupyter is refusing to display vector graphics, and will display the image only if it is very low-resolution. Wouldn't it be nice if there were a way to do this within Sage...

2023-09-18 09:21:57 +0200 received badge  Scholar
2023-09-18 09:21:55 +0200 commented question How to plot the real line in SageMath

Here's a question that seem relevant, but it's ten years old, things may have changed, and the replies do not look defin

2023-09-18 09:14:19 +0200 commented question How to plot the real line in SageMath

Of course one can try 2dplot in the following way: plot the line y=0 without axes, do a scatterplot to get the points on

2023-09-17 19:49:17 +0200 commented question How to plot the real line in SageMath

Just added some information.

2023-09-17 19:49:08 +0200 received badge  Editor (source)
2023-09-17 19:49:08 +0200 edited question How to plot the real line in SageMath

How to plot the real line in SageMath I am preparing a SageMath Jupyter notebook for expository purposes. I would like t

2023-09-17 14:05:10 +0200 asked a question How to plot the real line in SageMath

How to plot the real line in SageMath I am preparing a SageMath Jupyter notebook for expository purposes. I would like t