Giter Club home page Giter Club logo

aquarel's People

Contributors

frostime avatar hasan-alper avatar kianmeng avatar lgienapp avatar lucianosrp 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

aquarel's Issues

set_tick_labels location parameter produces a value error

theme = load_theme("arctic_dark").set_tick_labels(location="top")
theme.apply()

produces

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [2], line 2
      1 theme = load_theme("arctic_dark").set_tick_labels(location="top")
----> 2 theme.apply()

File ~/Documents/aquarel/aquarel/theme.py:325, in Theme.apply(self)
    323         if mapped_key == "axes.prop_cycle":
    324             value = cycler("color", value)
--> 325         mpl.rcParams.update({sub_key: value})
    326 else:
    327     # Special treatment for color palette, as this is otherwise not JSON serializable
    328     if mapped_key == "axes.prop_cycle":

File /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_collections_abc.py:940, in MutableMapping.update(self, other, **kwds)
    938 if isinstance(other, Mapping):
    939     for key in other:
--> 940         self[key] = other[key]
    941 elif hasattr(other, "keys"):
    942     for key in other.keys():

File ~/Documents/aquarel/venv/lib/python3.9/site-packages/matplotlib/__init__.py:648, in RcParams.__setitem__(self, key, val)
    646         cval = self.validate[key](val)
    647     except ValueError as ve:
--> 648         raise ValueError(f"Key {key}: {ve}") from None
    649     dict.__setitem__(self, key, cval)
    650 except KeyError as err:

ValueError: Key xaxis.labellocation: 'top' is not a valid value for xaxis.labellocation; supported values are ['left', 'center', 'right']

If location is left

ValueError: Key yaxis.labellocation: 'left' is not a valid value for yaxis.labellocation; supported values are ['bottom', 'center', 'top']

In the docs, valid options are given as this:

location (Optional[str]) – location of the tick labels, can be {“left”, “right”, “bottom”, “top”, “center”}, default: center

No themes available.

I just did a pip install.

from aquarel import list_themes
list_themes()

returns

[]

and load_theme("arctic_light")

raises

 ValueError: No theme named 'arctic_light' found.

Windows 11, Anaconda Python 3.9 installation.

I stepped into the code, it is globbing 'C:\anaconda3\lib\site-packages\aquarel\themes\*.json', but there is no
themes subdirectory in 'C:\anaconda3\lib\site-packages\aquarel, and a search of my drive confirms that arctic_light.json is not anywhere on my drive.

As an aside, I recommend using os.path.join to create the filepath, you have hardcoded in unix style with f"{loc}/themes/*.json"

os.path.join(loc, 'themes', '*.json')

Grid alpha value throws type error

with load_theme("arctic_light").set_grid(axis="x"):
    pd.Series(sizes).sort_values().plot.bar()

produces

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_16842/1244744067.py in <module>
----> 1 with load_theme("arctic_light").set_grid(axis="x"):
      2     pd.Series(sizes).sort_values().plot.bar()

/media/ssd/BIGSCIENCE/env/lib/python3.7/site-packages/aquarel/theme.py in set_grid(self, draw, axis, ticks, alpha, style, width)
    432                 "axis": axis if axis in self._axis_options else None,
    433                 "ticks": ticks if ticks in self._tick_options else None,
--> 434                 "alpha": alpha if 0 <= alpha <= 1 else None,
    435                 "style": style if style in self._line_style_options else None,
    436                 "width": width,

TypeError: '<=' not supported between instances of 'int' and 'NoneType'

Can not display in jupyter lab

I'm trying aquarel in jupyter lab, but it's doesn't work sometimes (can't display in jupyter lab page).

You may try this code:

import numpy as np
import matplotlib.pyplot as plt
from aquarel import load_theme

x = np.linspace(0, 10, 1000)
sinx = np.sin(x)
cosx = np.cos(x)

with load_theme('boxy_light'):
    plt.subplot(2, 1, 1)
    plt.plot(x, sinx)
    plt.plot(x, cosx)
    
    plt.subplot(2, 1, 2)
    plt.plot(x, cosx)
    plt.show()

My environment:

python: 3.10.8
aquarel: 0.0.5
matplotlib: 3.5.2

Add unit tests

Each set_ method should have an associated unit test that checks if the underlying matplotlib.rcparams are updated successfully and correctly.

Add FAQ to README

Possible Questions:

  • How is this different from style sheets? (#15)
  • Why can't I change an elements color in its corresponding set call directly?

Pandas plots do not have a modified style applied

When using

with load_theme("umbra_light"):
    pd.Series({"ROOTS":1.6, "OPT":1.02, "GPT3":1.63, "The Pile":0.89}).sort_values().plot.bar()

the style is applied as expected. However, any set_ calls on the style are not. Instead using seaborn to plot instead of pandas fixes it. Why?

Add legend styling options

Introduce a set_legend option to style the legend.
Maybe also legend-specific transforms, for example location?

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.