Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5b09d89
Try to pop vmin and vmax out of norm_kw
lukelbd Sep 2, 2019
a3ebbb1
Respect vmin and vmax as hard minimum/maximum
lukelbd Sep 2, 2019
ba2ce6f
Merge branch 'master' into panels-change-gridspec
lukelbd Sep 2, 2019
bad8024
Remove PanelAxes, and remove 'panels' args from subplots()! Colorbar …
lukelbd Sep 3, 2019
aa4cccf
On-the-fly figure colorbars and legends!
lukelbd Sep 3, 2019
c264999
Return axes_grid of panels, fix _panels_kwargs bug
lukelbd Sep 3, 2019
088a537
Fix axes_grid docstring
lukelbd Sep 3, 2019
bf87d3a
Minor
lukelbd Sep 3, 2019
cfe7e66
axes_grid docstring
lukelbd Sep 3, 2019
3205230
Zoom attribute change
lukelbd Sep 3, 2019
00bd9ff
Auto legend cleanup
lukelbd Sep 3, 2019
25934db
Comments
lukelbd Sep 3, 2019
73dd02c
Better 'span' fig panel aliases
lukelbd Sep 3, 2019
9254346
Add AAAS to journals; fix bug in pulling their dims
bradyrx Sep 4, 2019
32c4cc8
Move journal dictionary to top; add testing for journals
bradyrx Sep 4, 2019
7b6e4e0
Misc bugfixes and cleanup
lukelbd Sep 5, 2019
b8df9e1
Panels bugfix
lukelbd Sep 5, 2019
c67c3f8
Remove print statement
lukelbd Sep 5, 2019
5643867
Update documentation to reflect new colorbars, legends usage, add ins…
lukelbd Sep 5, 2019
4a43155
Merge pull request #31 from lukelbd/panels-change-gridspec
lukelbd Sep 5, 2019
acc905c
Remove duplicate 'Plotting wrappers' docs
lukelbd Sep 5, 2019
c2ae600
All caps constants
lukelbd Sep 6, 2019
f9c6eda
Name change fix
lukelbd Sep 6, 2019
c880ef1
Figure documentation
lukelbd Sep 6, 2019
7a611b5
_subplots_geometry cleanup
lukelbd Sep 6, 2019
43943a7
Merge pull request #30 from bradyrx/add_aaas_journals
lukelbd Sep 6, 2019
ddcc5fe
Repair dead links in wrappers.py
lukelbd Sep 6, 2019
bb3f21a
Merge branch 'master' of https://github.com/lukelbd/proplot
lukelbd Sep 6, 2019
039aea3
Demo stacked figure panels
lukelbd Sep 6, 2019
8804efc
_reassign_title bugfix, minor docs changes
lukelbd Sep 9, 2019
2b78889
Preliminary add_subplot changes
lukelbd Sep 9, 2019
695318b
Merge from master
lukelbd Sep 14, 2019
513d3e0
Fix import error
lukelbd Sep 14, 2019
ff760aa
Merge and fix docs conflicts
lukelbd Sep 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move journal dictionary to top; add testing for journals
  • Loading branch information
bradyrx committed Sep 4, 2019
commit 32c4cc8ede5d98dd479145f5db518cf1bb845c4c
11 changes: 10 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
=================
Changelog History
=================

ProPlot v1.0.0
--------------
==============
First official release. Coming soon! Future changes and releases will be documented.

Internals/Minor Fixes
---------------------
- Add AAAS journal specifications to ``journal`` keyword for ``proplot.subplots()``, fix bug breaking on certain journals, add testing. (:pr:`30`) `Riley X. Brady`_.


.. _`Luke Davis`: https://github.com/lukelbd
.. _`Riley X. Brady`: https://github.com/bradyrx
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
# 'matplotlib.sphinxext.plot_directive', # see: https://matplotlib.org/sampledoc/extensions.html
]

extlinks = {
'issue': ('https://github.com/lukelbd/proplot/issues/%s', 'GH#'),
'pr': ('https://github.com/lukelbd/proplot/pull/%s', 'GH#'),
}

# Do not run doctest tests, these are just to show syntax and expected
# output may be graphical
doctest_test_doctest_blocks = ''
Expand Down
40 changes: 22 additions & 18 deletions proplot/subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@
't':'top',
}

# Dimensions of figures for common journals
JOURNAL_SPECS = {
'pnas1': '8.7cm', # if 1 number specified, this is a tuple
'pnas2': '11.4cm',
'pnas3': '17.8cm',
'ams1': 3.2, # spec is in inches
'ams2': 4.5,
'ams3': 5.5,
'ams4': 6.5,
'agu1': ('95mm', '115mm'),
'agu2': ('190mm', '115mm'),
'agu3': ('95mm', '230mm'),
'agu4': ('190mm', '230mm'),
'aaas1': '5.5cm', # AAAS (e.g., Science) 1 column
'aaas2': '12cm', # AAAS 2 column
}


#-----------------------------------------------------------------------------#
# Miscellaneous stuff
#-----------------------------------------------------------------------------#
Expand Down Expand Up @@ -1473,30 +1491,16 @@ def _iter_axes(self):
#-----------------------------------------------------------------------------#
def _journals(journal):
"""Journal sizes for figures."""
table = {
'pnas1': '8.7cm', # if 1 number specified, this is a tuple
'pnas2': '11.4cm',
'pnas3': '17.8cm',
'ams1': 3.2, # spec is in inches
'ams2': 4.5,
'ams3': 5.5,
'ams4': 6.5,
'agu1': ('95mm', '115mm'),
'agu2': ('190mm', '115mm'),
'agu3': ('95mm', '230mm'),
'agu4': ('190mm', '230mm'),
'aaas1': '5.5cm', # AAAS (e.g., Science) 1 column
'aaas2': '12cm', # AAAS 2 column
}
value = table.get(journal, None)
# Get dimensions for figure from common journals.
value = JOURNAL_SPECS.get(journal, None)
if value is None:
raise ValueError(f'Unknown journal figure size specifier {journal!r}. ' +
'Current options are: ' + ', '.join(table.keys()))
'Current options are: ' + ', '.join(JOURNAL_SPECS.keys()))
# Return width, and optionally also the height
width, height = None, None
try:
width, height = value
except ValueError:
except (TypeError, ValueError):
width = value
return width, height

Expand Down
11 changes: 11 additions & 0 deletions proplot/tests/test_journals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

import proplot as plot
from proplot.subplots import JOURNAL_SPECS


# Loop through all available journals.
@pytest.mark.parametrize('journal', JOURNAL_SPECS.keys())
def test_journal_subplots(journal):
"""Tests that subplots can be generated with journal specifications."""
f, axs = plot.subplots(journal=journal)