@@ -67,17 +67,12 @@ def set_origin(data, origin):
67
67
class show_base (object ):
68
68
def save (self ,filename , ** kwargs ):
69
69
'''
70
- Saves the image as a `.png` using matplotlib.figure.savefig()
70
+ Saves the image using matplotlib.figure.savefig(). Default format is png if no extension is provided.
71
71
72
72
matplotlib kwargs can be passed, refer to documentation
73
73
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html
74
-
75
- Returns
76
- -------
77
- matplotlib.figure.Figure
78
- returns a matplotlib.pyplot figure object
79
-
80
74
'''
75
+
81
76
file ,extension = os .path .splitext (os .path .abspath (filename ))
82
77
extension = extension .strip ('.' )
83
78
@@ -139,10 +134,12 @@ class show1D(show_base):
139
134
Note
140
135
----
141
136
142
- The figure can be saved using the `save` method . i.e.
143
- >>> fig = show2D(data, title='My Plot')
137
+ The figure can be saved using the `save` method . i.e:
138
+
139
+ >>> fig = show1D(data, title='My Plot')
144
140
>>> fig.save('/path/to/output.png')
145
141
142
+
146
143
Examples
147
144
--------
148
145
@@ -190,6 +187,7 @@ class show1D(show_base):
190
187
191
188
192
189
To save the figure, use the `save` method.
190
+
193
191
>>> from cil.utilities.display import show1D
194
192
>>> from cil.utilities import dataexample
195
193
>>> data = dataexample.SIMULATED_SPHERE_VOLUME.get()
@@ -426,9 +424,11 @@ class show2D(show_base):
426
424
Note
427
425
----
428
426
429
- The figure can be saved using the `save` method . i.e.
427
+ The figure can be saved using the `save` method . i.e:
428
+
430
429
>>> fig = show2D(data, title='My Plot')
431
430
>>> fig.save('/path/to/output.png')
431
+
432
432
'''
433
433
434
434
def __init__ (self ,datacontainers , title = None , slice_list = None , fix_range = False , axis_labels = None , origin = 'lower-left' , cmap = 'gray' , num_cols = 2 , size = (15 ,15 )):
@@ -1060,9 +1060,11 @@ class show_geometry(show_base):
1060
1060
Note
1061
1061
----
1062
1062
1063
- The figure can be saved using the `save` method . i.e.
1064
- >>> fig = show2D(data, title='My Plot')
1063
+ The figure can be saved using the `save` method . i.e:
1064
+
1065
+ >>> fig = show_geometry(geometry)
1065
1066
>>> fig.save('/path/to/output.png')
1067
+
1066
1068
'''
1067
1069
1068
1070
0 commit comments