Code Monkey home page Code Monkey logo

calmap's People

Contributors

darkmatter2222 avatar kianmeng avatar ma-schmidt avatar martijnvermaat 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  avatar  avatar  avatar  avatar  avatar  avatar

calmap's Issues

Color of year labels separate

If fillcolor is specified, it's also used as the color for the yearlabels. This can be very impractical if you want days with no data to be shown in white. Then the yearlabels vanish.

Font is causing trouble in Linux cronjobs

If I use your calmap function on my Linux Red Hat Enterprise distribution, I'll get the warning
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.
Normally the warning will be just ignored, but if executed in the context of a cronjob it will cause the job to exit.
In your code the Font is defined in Line 308:

ylabel_kws = dict(
        fontsize=32,
        color=kwargs.get('fillcolor', 'whitesmoke'),
        fontweight='bold',
        fontname='Arial',
        ha='center')

Could this be changed to fontfamily = 'serif' or to a parameter?

Since I don't have admin rights on this machine there is no way for me to just install the missing Font.

AttributeError: 'AxesSubplot' object has no attribute 'get_axis_bgcolor'

When trying to run the sample code from the documentation

import numpy as np; np.random.seed(sum(map(ord, 'calmap')))
import pandas as pd
import calmap

all_days = pd.date_range('1/15/2014', periods=700, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)

calmap.yearplot(events, year=2015)

I get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-48f9d523cd2f> in <module>()
----> 1 calmap.yearplot(events, year=2014)

~/anaconda3/lib/python3.6/site-packages/calmap/__init__.py in yearplot(data, year, how, vmin, vmax, cmap, fillcolor, linewidth, linecolor, daylabels, dayticks, monthlabels, monthticks, ax, **kwargs)
    144         # background so in that case we default to white which will usually be
    145         # the figure or canvas background color.
--> 146         linecolor = ax.get_axis_bgcolor()
    147         if ColorConverter().to_rgba(linecolor)[-1] == 0:
    148             linecolor = 'white'

AttributeError: 'AxesSubplot' object has no attribute 'get_axis_bgcolor'

Deprecation warnings with Matplotlib 2.0.x

When run with Matplotlib 2.0.2 (Python 3.6.2) I get the following deprecation warnings:

/.../venv/lib/python3.6/site-packages/calmap/__init__.py:128: FutureWarning: how in .resample() is deprecated
the new syntax is .resample(...).sum()
  by_day = data.resample('D', how=how)
/.../venv/lib/python3.6/site-packages/calmap/__init__.py:146: MatplotlibDeprecationWarning: The get_axis_bgcolor function was deprecated in version 2.0. Use get_facecolor instead.
  linecolor = ax.get_axis_bgcolor()

Just a heads up for future proofing.

How to add a colorbar legend next to a calmap.calendarplot?

Hi,

I'm currently heavily relying on your module to plot calendar heatmap. Your module is great but I wonder
If you know a simple way to put a colorbar for the whole figure on the left of the calendar heatmap figure.
It could also be a neat feature in your next iteration on the module to have an option to put automatically the colorbar when creating the heatmap.

Bug with the 'sum' aggregation.

When I run the code on the doc page:
import numpy as np; np.random.seed(sum(map(ord, 'calmap')))
import pandas as pd
import calmap

all_days = pd.date_range('1/15/2014', periods=700, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)
calmap.yearplot(events, year=2015)
I get the following result:
screenshot1
Only when I change the aggregation to be mean, I get the expected result:

calmap.yearplot(events, year=2015,how=u'mean')
screenshot from 2019-02-03 22-36-33

python version: 3.7.1
pandas version: 0.23.4
calmap version: 0.0.7
matplotlib version: 3.0.1

FutureWarning: how in .resample() is deprecated

Using how in return a Future Warning

/Users/xxxx/.virtualenvs/calmap/lib/python2.7/site-packages/calmap/__init__.py:294: FutureWarning: how in .resample() is deprecated
the new syntax is .resample(...).count()
  by_day = data.resample('D', how=how)

should be easy to fix, I'll see if i can submit a PR.

Possibility to limit months

Great tool, thank you for making this.

I'm visualising extreme cold temperatures, and these only happen from December through March. It would be nice to be able to limit months in the plot and rearrange them to overlap years.

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.