Closed
Description
Ideas and decisions regarding the design of package structure and API for splot
Overall package idea
- support PySAL with lightweight plotting functionality:
.plot
methods for objects called fromsplot
and- functionality found under
splot.sub_package
namespace depending on PySAL object that is plotted
- Based on
matplotlib
andgeopandas
splot.mapping
offers tools for coropleth, color and mapping support
Decisions (indicating implementation status):
- integration of
splot.plot.py
intosplot._viz_mpl.py
- integration of
giddy
visualisations insplot
- update and integrate functionality from
mapping.py
intosplot._viz_mpl.py
-
.mpl
functions returnfig, ax
- API Structure of
splot
(See API - Package Structure comment):- hierarchy with submodules named after statistics visualised (
splot.giddy
), common_viz_utils.py
for utility functions used by all subpackages - integrating
splot
functionality as.plot
methods in sub packages (see Idea Collection: Functionality to support in splot #10 for supported functionality
- hierarchy with submodules named after statistics visualised (
- degree of customisation user can access: high degree of customisation through keyword dictionaries
- dependency on:
- Matplotlib only
- Geopandas
- Seaborn
- documentation in accordance to general PySAL [submodule contract](url
http://pysal.org/getting_started.html#submodule-contract)
To be decided:
Open questions/ ideas:
Rejected options:
- API Structure of
plot
(See API - Package Structure comment):- hierarchy with submodules, one per plotting package (now
splot.mpl
andsplot.bk
), chose function names according to statistics they are helping to visualise (e.g.moran_scatterplot()
,local_autocorrelation_statistics()
...)
- hierarchy with submodules, one per plotting package (now
- API Structure of
plot
(See API - Package Structure comment):- same implementations of visualisations in each (e.g.
.mpl
) submodule:
* e.g.mplot
,plot_choropleth
,plot_local_autocorrelation
,... forbk
andmpl
* except if one plotting package doesn't have the needed features (e.g. if interactivity is essential,matplotlib
may not be able to create such a plot)
- same implementations of visualisations in each (e.g.
- keywords common to all functions in the same order:
- e.g. ...(moran_loc, df, attribute, p, region_column, plot_width, plot_height,...)
- for
splot.mpl
only:ax
- for
splot.bk
only:reverse_colors
plot(method="interactive")
option, more flexibility by integrating submodules instead of function calls