Skip to content

Commit f0f97a4

Browse files
gfardellhrobarts
andauthored
Doc string formatting for show1D (#2027)
* Doc string formatting for show1D --------- Signed-off-by: Gemma Fardell <[email protected]> Co-authored-by: Hannah Robarts <[email protected]>
1 parent c79eda4 commit f0f97a4

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Wrappers/Python/cil/utilities/display.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,12 @@ def set_origin(data, origin):
6767
class show_base(object):
6868
def save(self,filename, **kwargs):
6969
'''
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.
7171
7272
matplotlib kwargs can be passed, refer to documentation
7373
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-
8074
'''
75+
8176
file,extension = os.path.splitext(os.path.abspath(filename))
8277
extension = extension.strip('.')
8378

@@ -139,10 +134,12 @@ class show1D(show_base):
139134
Note
140135
----
141136
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')
144140
>>> fig.save('/path/to/output.png')
145141
142+
146143
Examples
147144
--------
148145
@@ -190,6 +187,7 @@ class show1D(show_base):
190187
191188
192189
To save the figure, use the `save` method.
190+
193191
>>> from cil.utilities.display import show1D
194192
>>> from cil.utilities import dataexample
195193
>>> data = dataexample.SIMULATED_SPHERE_VOLUME.get()
@@ -426,9 +424,11 @@ class show2D(show_base):
426424
Note
427425
----
428426
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+
430429
>>> fig = show2D(data, title='My Plot')
431430
>>> fig.save('/path/to/output.png')
431+
432432
'''
433433

434434
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):
10601060
Note
10611061
----
10621062
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)
10651066
>>> fig.save('/path/to/output.png')
1067+
10661068
'''
10671069

10681070

0 commit comments

Comments
 (0)