lantunes / cellpylib

A library for working with Cellular Automata, for Python.
https://cellpylib.org
Apache License 2.0
228 stars 32 forks source link

[JOSS] Consider adding axis labels to 1D plots #19

Closed blsqr closed 3 years ago

blsqr commented 3 years ago

While I have worked with 2D CA a lot, I'm not particularly used to 1D CA and it seems to me that there are different conventions for which axis is associated with time and space. What do you think about automatically adding axis labels (x and time) to the 1D CA plots?

The signature could be:

def plot(ca, title='', *, add_labels=True):
    # ...

For consistency, I would propose to implement the same functionality in all plot functions, but maybe use a different default; for animations of 2D CAs the labels are less relevant, imo.

lantunes commented 3 years ago

I have updated the joss_review branch with a change to the plot and plot_multiple 1D plot functions: I have added two optional arguments to the signature: xlabel (default is empty) and ylabel (default is time). In my opinion, the x on the x-axis is not very informative, but I am flexible. Also, I have not added the optional x- and y-labels for the 2D plots.

blsqr commented 3 years ago

That's a good solution 👍 I agree that for 2D this is not necessary, given the implied spatial representation.