e-hulten / july Goto Github PK
View Code? Open in Web Editor NEWA small library for creating pretty heatmaps of daily data.
License: MIT License
A small library for creating pretty heatmaps of daily data.
License: MIT License
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)
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.
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.
Lines 207 to 242 in 953ef3e
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)
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")
matplotlib.axes.Axes.text
class have color or c - color
parameter documentation link.**kwargs
Mayhap there are other ways to fix it
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
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")
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?
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
Line 55 in 953ef3e
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
Line 68 in 953ef3e
I get TypeError: Expected 'date' to be type: [str, datetime.date, datetime.datetime]. Got: <class 'numpy.datetime64'>.
My data type: datetime64[ns]
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.
Hi all,
I'm gettting a Matplot depreciation warning when running the following (note I'm running this within a streamlit application, not sure if this may have an influence)
# Show calendar
dates = date_range("2020-01-01", "2020-12-31")
data = np.random.randint(0, 100, len(dates))
## Create a figure with a single axes
fig, ax = plt.subplots()
## Tell july to make a plot in a specific axes
july.month_plot(dates, data, month=2, date_label=True, ax=ax, colorbar=True)
pip list gives the following
pip list
Package Version
------------------------- -----------
altair 5.3.0
anyio 4.4.0
attrs 23.2.0
blinker 1.8.2
cachetools 5.3.3
certifi 2024.7.4
charset-normalizer 3.3.2
click 8.1.7
contourpy 1.2.1
cycler 0.12.1
fonttools 4.53.1
gitdb 4.0.11
GitPython 3.1.43
greenlet 3.0.3
h11 0.14.0
httpcore 1.0.5
httpx 0.27.0
idna 3.7
Jinja2 3.1.4
jsonschema 4.23.0
jsonschema-specifications 2023.12.1
july 0.1.3
kiwisolver 1.4.5
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.9.1
mdurl 0.1.2
numpy 2.0.0
packaging 24.1
pandas 2.2.2
pillow 10.4.0
pip 24.1.2
protobuf 5.27.2
psycopg2-binary 2.9.9
pyarrow 16.1.0
pydeck 0.9.1
Pygments 2.18.0
pyparsing 3.1.2
python-dateutil 2.9.0.post0
python-dotenv 1.0.1
pytz 2024.1
referencing 0.35.1
requests 2.32.3
rich 13.7.1
rpds-py 0.19.0
setuptools 70.3.0
six 1.16.0
smmap 5.0.1
sniffio 1.3.1
SQLAlchemy 2.0.31
streamlit 1.36.0
tenacity 8.5.0
toml 0.10.2
toolz 0.12.1
tornado 6.4.1
typing_extensions 4.12.2
tzdata 2024.1
urllib3 2.2.2
watchdog 4.0.1
wheel 0.43.0
Any tips what the issue may be? Looking forward to your ideas, and thanks in advance!
not an an issue, but rather a question / feature request.
I would like to have an option that would implement grid around each day...
Seems like a bug?
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.
Hi,
please add git tags for releases, to one can download versioned sources directly from github
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.