You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updating docs
* clean up
* update examples
* style extensions in yml
* dark style example
* fix some styles
* comment
* automate example code in docs
* clean up examples
* style fixes
* readme
Copy file name to clipboardExpand all lines: docs/examples.md
+15-98
Original file line number
Diff line number
Diff line change
@@ -4,126 +4,43 @@ This page has a few examples to get you familiar with Starplot and how it works.
4
4
2.[Star Chart with an Extra Object Plotted](#star-chart-with-an-extra-object-plotted)
5
5
3.[Map of Orion](#map-of-orion)
6
6
7
+
8
+
7
9
## Star Chart for Time/Location
8
-
To create a star chart for tonight's sky as seen from [Palomar Mountain](https://en.wikipedia.org/wiki/Palomar_Mountain) in California:
10
+
To create a star chart for the sky as seen from [Palomar Mountain](https://en.wikipedia.org/wiki/Palomar_Mountain) in California on July 13, 2023 at 10pm PT:
9
11
10
12
```python
11
-
from datetime import datetime
12
-
from pytz import timezone
13
-
import starplot as sp
14
-
15
-
tz = timezone("America/Los_Angeles")
16
-
17
-
p = sp.ZenithPlot(
18
-
lat=33.363484,
19
-
lon=-116.836394,
20
-
dt=tz.localize(datetime.now().replace(hour=22)),
21
-
limiting_magnitude=4.6,
22
-
style=sp.styles.ZENITH_BLUE_MEDIUM,
23
-
resolution=2000,
24
-
)
25
-
p.export("01_star_chart.png")
13
+
{% include 'examples/example_1.py'%}
26
14
```
27
-
The created file should look something like this:
28
15
29
-

30
-
31
-
!!! info "Does your result look different?"
16
+
The created file should look something like this:
32
17
33
-
Your result may look a little different depending on the date/time you run this code (because the position of the stars in the sky depends on time/location). But, the example above reflects what the chart would like for a day in July.
18
+

34
19
35
20
36
21
## Star Chart with an Extra Object Plotted
37
22
38
23
Building on the first example, you can also plot additional objects and even customize their style. Here's an example that plots the [Coma Star Cluster](https://en.wikipedia.org/wiki/Coma_Star_Cluster) (Melotte 111) as a red star and also changes the plot style to `GRAYSCALE`:
The following code will create a simple map plot that shows the area around the constellation Orion, including an extra marker for M42 - The Great Orion Nebula:
75
35
76
36
```python
77
-
import starplot as sp
78
-
79
-
style = sp.styles.MAP_BLUE_LIGHT.extend(
80
-
{
81
-
"bayer_labels": {
82
-
"font_name": "GFS Didot", # use a better font for Greek letters
0 commit comments