Code Monkey home page Code Monkey logo

july's People

Contributors

busload-pessimist-cornbread avatar e-hulten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

july's Issues

Sliding calendar

Hi, is it possible to get a sliding calendar like the on I see on my github profile?

It looks like the ones that come out of july always start at January and end in December while the github calendar starts at today - 356 days and today is the last square in the calendar.

How to show/save the output

Hello, in the examples there are only code snippets to create the objects, but no actual working code to show/print/save images to file.

I am not familiar with matplotlib and I'd appreciate some code examples for that.

Allow customized title in calendar_plot

The current calendar_plot() auto generates the title based on data.
However, it would be nice if it allow user to input their customized title. E.g. "UK Holidays", "Chelsea Match Days", etc.

Missing axes argument in calendar_plot

Hello, I wanted to thank you for this amazing library! It's been really usefull for my projects. I detected what seems to be a bug in the calendar_plot arguments: there is no ax argument, but it appears in the documentation. I can make a pull request with a fix if that's ok.

july/src/july/plot.py

Lines 207 to 242 in 953ef3e

def calendar_plot(
dates: List[Union[str, datetime.date, datetime.datetime]],
data: List[Any],
cmap: Union[str, LinearSegmentedColormap, ListedColormap] = "july",
value_label: bool = False,
date_label: bool = False,
weeknum_label: bool = True,
month_label: bool = True,
value_format: str = "int",
title: bool = True,
ncols: int = 4,
figsize: Optional[Tuple[float, float]] = None,
**kwargs
) -> Axes:
"""Create calendar shaped heatmap of all months im input dates and data.
Args:
dates: List like data structure with dates.
data: List like data structure with numeric data.
cmap: Colormap. Any matplotlib colormap works.
value_label: Whether to add value label inside grid.
date_label: Whether to add date label inside grid.
weeknum_label: Whether to label the short axis with week numbers.
month_label: Whether to add month label(s) along the long axis.
value_format: Format of value_label: 'int' or 'decimal'. Only relevant if
`value_label` is True.
title: Title of the plot.
ncols: Number of columns in the calendar plot.
ax: Matplotlib Axes object.
figsize: Figure size. Defaults to sensible values determined from 'ncols'.
kwargs: Parameters passed to `update_rcparams`. Figure aesthetics. Named
keyword arguments as defined in `update_rcparams` or a dict with any
rcParam as key(s).
Returns:
Matplotlib Axes object.
"""

grid around each day (question)

not an an issue, but rather a question / feature request.
I would like to have an option that would implement grid around each day...

Open up API to allow for custom Normalize classes

Currently methods like heatmap don't allow for custom Normalize objects to be fed into the matplotlib drawing process (i.e. when calling pcolormesh you can provide a norm argument) and only allow for custom Colormaps.

This makes it hard to have e.g. logarithmically scaled color in the plots without directly scaling the actual data, which messes up the colorbar values etc. because of the way matplotlib separates normalization of data and after that color assignment to the normalized values using color maps. Is it possible to open up method arguments to allow to pass in those custom Normalize objects?

july.calendar_plot scale?

Is there a way to display a color_bar for the calendar_plot?

Similar to july.heatmap(osl_df.date, osl_df.temp, cmap="golden", colorbar=True, title="Average temperatures: Oslo , Norway")

Add colorbar argument to july.calendar_plot()

Hey there,

Just throwing this idea out; I think having a legend next to the individual months [shown below] would be a nice feature to have as an arg to july.calendar_plot(). If I'm blind and it already exists, could you let me know where?

Thanks,
BK
Calendar

numpy.datetime64 not accepted as date

I get TypeError: Expected 'date' to be type: [str, datetime.date, datetime.datetime]. Got: <class 'numpy.datetime64'>.
My data type: datetime64[ns]

List of months support

Hello,

Thank you very much for the super cool package.

I would like to inquire whether it's possible to select specific months for plotting by passing a list of months. For instance, I'd like to plot only the months [10, 11, 12], without plotting the whole the year.
Currently, I can achieve this by calling month_plot() three times, like so:

from mpl_toolkits.axes_grid1 import Grid
fig = plt.figure()
grid = Grid(fig, rect=111, nrows_ncols=(1,3),
            axes_pad=0.25, label_mode='L',
            )
for i, ax in enumerate(grid):
    july.month_plot(dates_list, data, month=months[i], value_label=True, ax=ax)

Releases/tags

Hi,

please add git tags for releases, to one can download versioned sources directly from github

thanks

`value_label` - `add_value_label` - color of value_label

Describe the workflow you want to enable

Hi all, I wanted to use gray-scale colormap and add labels. july.calendar_plot and july.month_plot allowed me to add labels (a.k.a. ticks, values inside calendar cells) with value_label=True param, but did not allow me to change the color of these labels.

Example image and code attached

july.calendar_plot(data=df_plot.values, dates=df_plot.index, cmap="gray_r", value_label=True, title=False)

image

Describe your proposed solution

  1. As far as I understand the source code, the affected line is below:
    https://github.com/e-hulten/july/blob/master/src/july/helpers.py#L116
july/src/july/helpers.py
> 105 | def add_value_label(ax, cal, value_format):
> ...
> 118 | ax.text(j + 0.5, i + 0.5, val_format.format(z), ha="center", va="center")
  1. Objects of matplotlib.axes.Axes.text class have color or c - color parameter documentation link.
  2. We might add additional param responsible for color of values or transfer **kwargs

Describe alternatives you've considered, if relevant

Mayhap there are other ways to fix it

Additional context

Same issue may occur with other colormaps - it is difficult to separate dark colors from dark backgrounds (or to separate same tints, shades, tones in general). Also, color are important both from æsthetical and accessibility points see

make modifications of matplotlib configuration on a local level

In order to not interfere with other potential components relying on matplotlib and implicitly expecting some or all configurations, namely rcParams, to have their respective default value, I would appreciate if changes to rcParams only influenced july.

Currently, it is reconfigured globally in

mpl.rcParams.update(rcmod)

One possibility to achieve this would be for update_rcparams to use matplotlib.rc_context – returning a new independent context manager, to be used in

update_rcparams(**kwargs)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.