billingegroup / bg-mpl-stylesheets Goto Github PK
View Code? Open in Web Editor NEWMatplotlib style sheets
License: Other
Matplotlib style sheets
License: Other
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
The imports in the example Python scripts bg-mpl-stylesheets/example/plot.py and bg-mpl-stylesheets/example/color_cycle.py should be updated to use the current name(s) of the package as well as line 2 in color_cycle.py should be removed altogether.
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
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)
Figure out group style sheets in general.
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.
@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.
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.
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
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
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)
this would be the list of colors that we use in the cycler, but would be then more easily accessible without using the cycler
@dragonyanglong would it also be possible to plot the bg_style
colors in the readme? I think code to do it could be stolen from here:
https://matplotlib.org/3.1.0/gallery/color/named_colors.html
so it could be quick. It would certainly be very useful. For the label for each color, maybe just give its number in the color list?
Would it be possible to upload the same figures as here using that stylesheet so we can see what it will look like?
The previous accidental release was almost fully taken care of, but there is still a remnant release tag that should be cleaned up so that it does not conflict with actual releases.
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.