Closed swright87 closed 4 months ago
For reference, the two attachments here were generated using the library, one using matplotlib, one using the TeX engine (though the LaTeX needs to be edited to escape the % symbols in the application names!).
@laserkelvin : There seems to be an issue in compatibility between black and flake8.
Initially I was failing the checks because black thought everything was fine, but flake8 suggested that black would make a change. I updated my local installs, and then black did make a change. But now black on the CI system indicates that it prefers how it was previously.
Updated to include PGFPlot generated NavCharts too.
See: navchart.pdf
I closed and re-opened in an attempt to re-trigger the CI. What I'm seeing is that the old format test failed. I don't understand why they're still relevant. Any idea, @laserkelvin?
Yeah I have no idea why that is the case...
The backend has been reworked using the structure from the current main
repo. All previous commits have been squashed into a single commit.
A new backend has been added that uses TeX/pgfplots to build TeX cascade and navchart plots.
This uses jinja2 to generate TeX from some templates.
kwargs
instead. Only universal parameters included in the main args, with everything else pushed in to kwargs;Thanks, @swright87. I think this looks good to merge now. I fixed a few things I noticed on re-review, and rebased on top of main to fix the conflicts.
Now that the functionality is finished, we also need some tests and examples. These could be the same thing (see #37).
EDIT: Oh, it's because there are "%" symbols in the labels, which are interpreted as TeX comments. I don't know enough about jinja to know how to escape them, though.
I started to fix this in Python, but it seems the easiest (and perhaps least error prone) fix is to put the escaping directly in to the Jinja templates. It should escape all of the potentially problematic characters in LaTeX (#, %, $, ^, etc.).
Proposed changes
This PR adds a new backend that generates TeX files that contain code to build cascade plots and navigation charts using PGFPlots.
Some of the customisations available in the MatPlotLib backend are still available within this implementation; however, the main motivation behind this is that the output can be infinitely modified with anything PGFPlots compliant. The data can also be easily updated in the future without using the library.