Skip to content

Commit ce6d856

Browse files
committed
sage: more 2d plots, some renaming
1 parent 013358c commit ce6d856

File tree

6 files changed

+53
-6
lines changed

6 files changed

+53
-6
lines changed

src/sage/api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License: Creative Commons: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
44

55
language: sage
6-
category: Extras / Queries
6+
category: Miscellaneous / Queries
77
---
88
title: Online Encyclopedia of Integer Sequences
99
descr: |

src/sage/cython.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CoCalc Snippets Documentation File
2+
# Copyright: SageMath Inc., 2019
3+
# License: Creative Commons: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
4+
---
5+
language: sage
6+
category: Miscellaneous / Cython
7+
---
8+
title: "Cython Class"
9+
descr: "Defines a [Cython](https://cython.org/) class"
10+
code: |
11+
%cython
12+
cdef class MyClass:
13+
"""
14+
This is a Cython class.
15+
"""
16+
cdef int a
17+
def __init__(self, int a):
18+
self.a = a
19+
def __repr__(self):
20+
return "Instance of MyClass with a = %s"%self.a
21+
print(MyClass(5))

src/sage/files.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License: Creative Commons: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
44

55
language: sage
6-
category: Extras / Files
6+
category: Miscellaneous / Files
77
setup: 'import csv'
88
---
99
title: Saving/Loading Sage Objects

src/sage/interact.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License: Creative Commons: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
44
---
55
language: sage
6-
category: Extras / Interact
6+
category: Miscellaneous / Interact
77
---
88
title: Introduction
99
descr: |

src/sage/milp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License: Creative Commons: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
44
---
55
language: sage
6-
category: Extras / Mixed Integer Linear Programming
6+
category: Miscellaneous / Mixed Integer Linear Programming
77
---
88
title: Simple Linear Program
99
descr: |

src/sage/plotting.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,40 @@ title: Cool 2D Plot
2929
code: plot(x * sin(x), (x, -10, 10))
3030
descr: Plot of $f(x) = x \sin(x)$.
3131
---
32+
title: Lines
33+
code: |
34+
line([(0,0), (1,2), (1/2,pi), (1/2,pi/2)], color='darkgreen', thickness=3)
35+
---
36+
title: 2D Polygons
37+
code: |
38+
a = polygon2d([(0,0), (1,2), (1/2,pi), (1/2,pi/2)], color='orange')
39+
b = polygon2d([(0,0), (1,2), (1/2,pi), (1/2,pi/2)], color='black', fill=False, thickness=3)
40+
show(a + b)
41+
---
42+
title: Parametric Plots
43+
code: |
44+
parametric_plot([cos(x) + 2*cos(x/4), sin(x) - 2*sin(x/4)], (x,0,8*pi), color='green', thickness=3, fill = True)
45+
---
46+
title: Random Walk
47+
code: |
48+
stats.TimeSeries(1000).randomize('normal').sums().plot()
49+
---
50+
title: Text
51+
code: |
52+
text(r"Text and LaTeX: $\\alpha^3 + 1$", (1,1), color="black", fontsize=15, rotation=30)
53+
---
54+
title: Points
55+
code: |
56+
show(points([(1,0), (sqrt(2)/2,sqrt(2)/2), (0,1), (1/2,1/2)], color='darkgreen', pointsize=50), aspect_ratio=1)
57+
---
58+
category: Plotting/3D
59+
---
3260
title: Simple 3D Plot
3361
code: |
3462
var('x y')
3563
plot3d(sin(x) * cos(y), (x, -10, 10), (y, -10, 10))
3664
descr: 3D plot of $f(x,y) = \sin(x)\cos(y)$.
3765
---
38-
category: Plotting/3D
39-
---
4066
title: "Cube"
4167
descr: "Show a colored cube"
4268
code: |

0 commit comments

Comments
 (0)