Skip to content

Commit db74af7

Browse files
authored
v0.4.1 (#34)
* pass through kwargs on export * doc string * demo page
1 parent 7d3899f commit db74af7

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ repo_url: https://github.com/steveberardi/starplot
44

55
nav:
66
- Overview: index.md
7+
- Demo: demo.md
78
- Installation: installation.md
89
- Examples: examples.md
910
- Reference:

scripts/scratchpad.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def create_zenith():
102102
adjust_text=True,
103103
)
104104
p.refresh_legend()
105-
p.export("temp/zenith-poway.svg", format="svg")
105+
p.export("temp/zenith-poway.png", format="png", transparent=True)
106106

107107

108108
def create_map_mercator():
@@ -294,8 +294,8 @@ def dump_extensions():
294294
# create_map_mercator()
295295
# create_map_stereo_north()
296296
# create_map_stereo_south()
297-
create_map_orion()
298-
create_map_sgr()
297+
# create_map_orion()
298+
# create_map_sgr()
299299

300300
# create_map_with_planets()
301301

src/starplot/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Star charts and maps"""
22

3-
__version__ = "0.4.0"
3+
__version__ = "0.4.1"
44

55
from .base import StarPlot # noqa: F401
66
from .zenith import ZenithPlot # noqa: F401

src/starplot/base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ def close_fig(self) -> None:
120120
if self.fig:
121121
plt.close(self.fig)
122122

123-
def export(self, filename: str, format: str = "png", padding: float = 0):
123+
def export(self, filename: str, format: str = "png", padding: float = 0, **kwargs):
124124
"""Exports the plot to an image file.
125125
126126
Args:
127127
filename: Filename of exported file
128128
format: Format of file: "png" or "svg"
129129
padding: Padding (in inches) around the image
130+
**kwargs: Any keyword arguments to pass through to matplotlib's `savefig` method
130131
131132
"""
132133
self.fig.savefig(
@@ -135,6 +136,7 @@ def export(self, filename: str, format: str = "png", padding: float = 0):
135136
bbox_inches="tight",
136137
pad_inches=padding,
137138
dpi=144, # (self.resolution / self.figure_size * 1.28),
139+
**kwargs,
138140
)
139141

140142
def draw_reticle(self, ra: float, dec: float) -> None:

0 commit comments

Comments
 (0)