Code Monkey home page Code Monkey logo

bg-mpl-stylesheets's People

Contributors

cadenmyers13 avatar chiahaoliu avatar cj-wright avatar connorjbracy avatar dragonyanglong avatar mkwang2024 avatar pliu2781 avatar sbillinge avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bg-mpl-stylesheets's Issues

RuntimeError: Failed to process string with tex because latex could not be found

When using the bg_mpl_style on a Mac without latex installation the below error rises:

/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/_collections_abc.py:832: MatplotlibDeprecationWarning: Support for setting the 'text.latex.preamble' or 'pgf.preamble' rcParam to a list of strings is deprecated since 3.3 and will be removed two minor releases later; set it to a single string instead.
  self[key] = other[key]
Traceback (most recent call last):
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/texmanager.py", line 275, in _run_checked_subprocess
    report = subprocess.check_output(command,
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'latex'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/berrakozer/dev/pydatarecognition/pydatarecognition/main.py", line 129, in <module>
    main()
  File "/Users/berrakozer/dev/pydatarecognition/pydatarecognition/main.py", line 114, in main
    rank_plots = rank_plot(data_resampled[0][:,0], data_resampled[0][:, 1], cif_rank_pearson, cif_dict, OUTPUT_DIR)
  File "/Users/berrakozer/dev/pydatarecognition/pydatarecognition/plotters.py", line 80, in rank_plot
    plt.savefig(png_path / 'rank_plot.png', bbox_inches='tight')
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/pyplot.py", line 859, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/figure.py", line 2311, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2193, in print_figure
    self.figure.draw(renderer)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/figure.py", line 1863, in draw
    mimage._draw_list_compositing_images(
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 2747, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/text.py", line 681, in draw
    bbox, info, descent = textobj._get_layout(renderer)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/text.py", line 287, in _get_layout
    _, lp_h, lp_d = renderer.get_text_width_height_descent(
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py", line 227, in get_text_width_height_descent
    w, h, d = texmanager.get_text_width_height_descent(
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/texmanager.py", line 423, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/texmanager.py", line 309, in make_dvi
    self._run_checked_subprocess(
  File "/Users/berrakozer/anaconda3/envs/pydr/lib/python3.8/site-packages/matplotlib/texmanager.py", line 279, in _run_checked_subprocess
    raise RuntimeError(
RuntimeError: Failed to process string with tex because latex could not be found

Process finished with exit code 1

Provide example data and example code to also help newcomers

following @CJ-Wright it would be even more helpful if we could have some PDF data in an examples folder or sthg and some code that can build a few standard/common PDF plots so that we can see what they look like. Something like nanoarticle data, nanoparticle calculated and offset difference curve, maybe with a label (a) and axis labels etc.

The style needed when we embed in a pdf document is a bit different from when we do a live plot too, so we may need two style sheets. That can come in a later PR

Update README

Consider removing the >>> parts of the code snippets in the README so that all code snippets are uniform in style (and the >>> shouldn't be needed as code blocks are already distinct in-line)

Add documentation resolving cryptic LaTeX error due to missing OS libraries

Some users may get an error when trying to generate a plot after enabling the stylesheet due to a LaTeX error such as ! LaTeX Error: File 'type1ec.sty' not found. It seems this is due to some missing LaTeX support in basic installations, but can be resolved by installing additional packages such as: apt-get install dvipng texlive-latex-extra texlive-fonts-recommended cm-super. See StackOverflow Question for reference.

Close out the Gitlab version of the style-sheet

@dragonyanglong We don't want to create confusion by having two repos with two style sheets in. I think this one shoul dbe the canonical repo, so we need to delete the gitlab one, but before doing that, making sure that there is nothing in there that we need/want here.

Merge GitHub/conda-forge release config files

PR #20 contains the necessary updates to rever.xsh to perform the two-step release procedure of this package on GitHub followed by conda-forge (necessarily in that order).

After the merge, someone logged in under the Billingegroup should run rever 0.1.0 (or replacing "0.1.0" with whatever version number feels appropriate) in the root directory of the project to release it on GitHub which is a necessary precursor step to the conda-forge release.

Tight layout

Hi,
can you add this kwarg to the stylesheet, please?
'figure.autolayout': True,

This will make the figures in a tight layout. Sometimes I get the labels out of the bbox

release the package to conda-forge

Hi @st3107 , @sbillinge would like to publish this group plot style to conda-forge, so that everyone can simply install the package from there. can you help with it? or instruct me how to do that?

BTW, @sbillinge , would you like to give a better name for the package? Currently, it would be like

from billinge_style.bg_plt_style import bg_plt_style

rename repo and package name

Hi @sbillinge , I did some research. the repo name can have dash, but the package name should be underscore. pip will auto change it, but I am not sure conda.

So, please change the repo name into bg-mpl-stylesheet. I will then push PR to change the package names (i.e. the folders)

create bg-colorlist

this would be the list of colors that we use in the cycler, but would be then more easily accessible without using the cycler

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.