aewallin / allantools

Allan deviation and related time & frequency statistics library in Python
GNU Lesser General Public License v3.0
226 stars 77 forks source link

supporting kwargs in allantools.Plot.plot #70

Closed Justin318 closed 5 years ago

Justin318 commented 6 years ago

Please allow user to supply kwargs to the method plot for the class allantools.Plot

    def plot(self, atDataset, errorbars=False, grid=False, **kwargs):
        """overwriting the implementation from allantools

        Args:
            atDataset:
            errorbars:
            grid:

        Returns:

        """
        if errorbars:
            self.ax.errorbar(atDataset.out["taus"],
                             atDataset.out["stat"],
                             yerr=atDataset.out["stat_err"],
                             **kwargs
                             )
        else:
            self.ax.plot(atDataset.out["taus"],
                         atDataset.out["stat"],
                         **kwargs
                         )
        self.ax.set_xlabel("Tau")
        self.ax.set_ylabel(atDataset.out["stat_id"])
        self.ax.grid(grid, which="minor", ls="-", color='0.65')
        self.ax.grid(grid, which="major", ls="-", color='0.25')
MedericFourmy commented 5 years ago

I would like to have this as well, any plan for a merge request?

aewallin commented 5 years ago

hi @Justin318 and @MedericFourmy , I would be happy to merge a pull-request with the suggested kwargs.

yxie-git commented 5 years ago

I sent a pull request by two plot functions that I'm using currently to generate stable32 style plots. Maybe it's relevant to this issue? As a github starter, I'm not sure if I manipulated this 'pull request' correctly or do I need to write the code in plotclass? Sorry for the inconvenience if something is wrong with the uploading.