wilsonmr / anvil

Repository containing code related to flow based generative model
https://wilsonmr.github.io/anvil/
GNU General Public License v3.0
0 stars 2 forks source link

Matplotlib style sheet and visual improvements #74

Closed jmarshrossney closed 3 years ago

jmarshrossney commented 3 years ago

Added a .mplstyle file to produce plots that look consistent with the style used in our paper.

Also made some minor changes to existing figures and added a simple histogram for the magnetization. (I'll make a separate PR for bigger additions to plots - hopefully this histogram is sufficiently inoffensive that it doesn't distract from the main topic).

Currently one needs to use an extra arg anvil-sample --style style/anvil.mplstyle because I haven't decided/figured out whether/how to override the reportengine default (which I think is just the matplotlib default).

wilsonmr commented 3 years ago

I think we can add a default_style property to the sampling app class

wilsonmr commented 3 years ago

if you add an init file like this to style

import pathlib
defaultstyle = pathlib.Path(__file__).with_name('anvil.mplstyle')

then you can import it. You might need to double check that the style gets properly installed by pip install in a fresh env, it might require adding to the package_data in setup.py something like *.mplstyle

jmarshrossney commented 3 years ago

works in a fresh env without modifying setup.py, but good to check.

wilsonmr commented 3 years ago

Ah, it would appear not.. I think the behaviour is different if you use the actual install or the development install. In the latter you symlink to the git directory so the file will be present, but the point is if I were to fresh install and run pip install . then it wouldn't copy the file

jmarshrossney commented 3 years ago

yeah I spoke too soon, whoops. Though I'm a little confused - the "development install" is when we do pip install . ..? So this is what I did and it works ok. Am I right to say the problem is with the "normal" install?

wilsonmr commented 3 years ago

The development is when we use the -e option https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-e

jmarshrossney commented 3 years ago

ah!

wilsonmr commented 3 years ago

I appreciate both could be viewed as development installs - apologies for not being clear. I suppose I would call them binary install (through conda), manual install (pip install), development install (-e option) but that's completely my convention not universal haha

jmarshrossney commented 3 years ago

Ok let's try this again.

No need to apologise. On a positive note, if we make the documentation clear enough for me to understand I think it would qualify as "accessible" which is probably what we want!

wilsonmr commented 3 years ago

Yeah, I'll open an issue!

wilsonmr commented 3 years ago

Ok, I don't understand that last error. Do we need an extra package?

jmarshrossney commented 3 years ago

I don't either - everything passes in ~20s when I run locally, in a fresh env with pip install . .

jmarshrossney commented 3 years ago

I wonder if it's the fonts. I've used the STIX family because normal text matches the style of equations. Let me remove and re-check.