Skip to content

Commit

Permalink
Code style: Closing bracket on own line
Browse files Browse the repository at this point in the history
As suggested in code review.

Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
  • Loading branch information
jitseniesen and ccordoba12 authored Jan 2, 2024
1 parent 0464320 commit 4a0f8f2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
26 changes: 17 additions & 9 deletions spyder/plugins/ipythonconsole/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,24 @@ def setup_page(self):
'pylab/inline/height', min_=1, max_=20, step=1,
tip=_("Default is 4"))
fontsize_spin = self.create_spinbox(
_("Font size:")+" ", " "+_("points"),
'pylab/inline/fontsize', min_=5, max_=48, step=1.0,
tip=_("Default is 10"))
_("Font size:") + " ",
" " + _("points"),
'pylab/inline/fontsize',
min_= 5,
max_=48,
step=1.0,
tip=_("Default is 10")
)
bottom_spin = self.create_spinbox(
_("Bottom edge:")+" ",
" "+_("of figure height"),
'pylab/inline/bottom', min_=0, max_=0.3, step=0.01,
tip=_("The position of the bottom edge of the "
"subplots,\nas a fraction of the figure "
"height.\nThe default is 0.11."))
_("Bottom edge:") + " ",
" " + _("of figure height"),
'pylab/inline/bottom',
min_=0,
max_=0.3,
step=0.01,
tip=_("The position of the bottom edge of the subplots,\nas a "
"fraction of the figure height.\nThe default is 0.11.")
)
bottom_spin.spinbox.setDecimals(2)
bbox_inches_box = newcb(
_("Use a tight layout for inline plots"),
Expand Down
12 changes: 8 additions & 4 deletions spyder/plugins/ipythonconsole/widgets/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,18 @@ def send_mpl_backend(self, option=None):

# Font size
fontsize_o = float(self.get_conf(fontsize_n))
if fontsize_o is not None and (
option is None or fontsize_n in option):
if (
fontsize_o is not None
and (option is None or fontsize_n in option)
):
matplotlib_conf[fontsize_n] = fontsize_o

# Bottom part
bottom_o = float(self.get_conf(bottom_n))
if bottom_o is not None and (
option is None or bottom_n in option):
if (
bottom_o is not None
and (option is None or bottom_n in option)
):
matplotlib_conf[bottom_n] = bottom_o

# Print figure kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ def plot_in_plots_plugin(self, data, funcname):
bbox_inches = 'tight'
else:
bbox_inches = None

matplotlib_rc = {
'font.size': self.get_conf('pylab/inline/fontsize',
section='ipython_console'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ def check_rc(*args):
namespacebrowser.set_conf('mute_inline_plotting', True, section='plots')
namespacebrowser.plots_plugin_enabled = True
namespacebrowser.set_conf(
'pylab/inline/fontsize', 20.5, section='ipython_console')
'pylab/inline/fontsize', 20.5, section='ipython_console'
)
namespacebrowser.set_conf(
'pylab/inline/bottom', 0.314, section='ipython_console')
'pylab/inline/bottom', 0.314, section='ipython_console'
)

mock_figure = Mock()
mock_axis = Mock()
Expand Down

0 comments on commit 4a0f8f2

Please sign in to comment.