Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theming improvements, other fixes #176

Merged
merged 74 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
90c9877
do not use real text height for multiline text
Vindaar Oct 21, 2023
72a7837
[facets] allow assignment of facet plots in user defined order
Vindaar Oct 21, 2023
55684f4
update changelog
Vindaar Oct 21, 2023
c13177c
add experimental option `WritePlotCsv` to write CSVs for all plots
Vindaar Oct 21, 2023
164184f
update changelog
Vindaar Oct 21, 2023
07363d7
[raster] fix range of raster plots if other geoms added
Vindaar Oct 31, 2023
97a86e9
[histograms] improve histograms with minimal values != 0
Vindaar Oct 31, 2023
8b2d88c
[theme] add baseLabelMargin field to adjust distance tickLabel ⇔ label
Vindaar Oct 31, 2023
f10f07c
[misc] improve exception message when color parsing failed
Vindaar Oct 31, 2023
b345cb8
update changelog
Vindaar Oct 31, 2023
b91a376
fix typo of default `baseLabelMargin`
Vindaar Nov 4, 2023
2fa7218
use `expandTilde` in `ggsave`
Vindaar Dec 2, 2023
95c2030
improve logic detecting discreteness of arguments
Vindaar Dec 2, 2023
800c3ad
allow adjustment of plot size via `Theme`
Vindaar Dec 4, 2023
5732048
allow adjustment of annotation fonts via `Theme`
Vindaar Dec 4, 2023
2dc540d
scale grid lines and annotation font, allow custom base theme
Vindaar Dec 4, 2023
c08111d
import expandTilde for filenames and add docstring about baseTheme
Vindaar Dec 4, 2023
1ac35de
add useful `themeLatex`, adjustable by base theme
Vindaar Dec 4, 2023
3c2cbae
add `dataAsBitmap` support to embed PNG into vector graphic
Vindaar Dec 4, 2023
5ae35a3
[theme] argument to `theme_scale` allowed to be none
Vindaar Dec 6, 2023
454050f
[theme] adjust default `sideBySide` theme a bit
Vindaar Dec 6, 2023
028af62
[theme] add option `coord_fixed` for coordinate based plot ratio
Vindaar Dec 6, 2023
044a711
refactor `Facet` processing, incl fix for date scales on facets
Vindaar Dec 10, 2023
05da789
do not crash if `baseTheme` not given to `theme_font_scale`
Vindaar Dec 11, 2023
f8feb2c
[misc] add note about text height for example KOMAscript class
Vindaar Dec 11, 2023
7048a0f
add `gradient` option opposite `factor` to force continuous
Vindaar Dec 12, 2023
f39a06e
[ticks] update tickStyle, export
Vindaar Dec 13, 2023
92c1537
[legend] fix height of legend viewport if resized
Vindaar Dec 13, 2023
4648e5c
allow setting useTeX via Theme
Vindaar Dec 13, 2023
767f0ef
allow hiding of x or y labels individually, add helper theme procs
Vindaar Dec 13, 2023
a3ebaf0
[ridges] adjust styling of ridgeline plots
Vindaar Dec 13, 2023
ea46e65
fix usage of low/high in x/ylim if not float
Vindaar Dec 14, 2023
17d06cd
add `cool` colormap
Vindaar Dec 14, 2023
2807840
add fields to customize width/height of continuous/discrete legend
Vindaar Dec 14, 2023
f8864ae
adjust width/height of discrete legend, apply theme fields
Vindaar Dec 14, 2023
812a444
allow adjustment of scale in `scale_fill/color_continuous/gradient` p…
Vindaar Dec 14, 2023
63c9162
[theme] add helper to add two themes by `+`
Vindaar Dec 17, 2023
5705e62
[themes] add option to disable themeLatex fully if not using TeX
Vindaar Dec 18, 2023
54275f2
fix height of continuous legend
Vindaar Dec 18, 2023
837713d
fix date tick logic for non facet plots
Vindaar Dec 18, 2023
8f098b7
[facet] fix facet plots without free axes
Vindaar Dec 29, 2023
dce9c18
allow annotations to be defined by top/right
Vindaar Jan 31, 2024
72ab231
use correct font for legend tick labels
Vindaar Jan 31, 2024
11a6f38
add `dataAsBitmap` support for facet plots
Vindaar Jan 31, 2024
1f23e37
respect user set margins in facet plot
Vindaar Jan 31, 2024
3341c9f
make `aes` arguments to `ggplot` optional
Vindaar Jan 31, 2024
5383fc3
fix minor regression of histograms
Vindaar Jan 31, 2024
6b37083
add RT env var check for precision to use for text
Vindaar Jan 31, 2024
ea642e4
add support for RT theme using a TOML file
Vindaar Jan 31, 2024
535a271
adjust spacing used for discrete legends to match continuous legends
Vindaar Jan 31, 2024
4a17178
fix minor typo
Vindaar Jan 31, 2024
76730e2
minor fix for TOML theme parsing due to whitespace
Vindaar Jan 31, 2024
af578d2
update changelog
Vindaar Jan 31, 2024
e4e84e4
add `parsetoml` dependency
Vindaar Jan 31, 2024
cc60d67
pin new ginger dependency
Vindaar Jan 31, 2024
c463531
fully disable `themeLatex` if `useTeX=false` by default
Vindaar Feb 9, 2024
ddc8cba
draw histograms as lines in discrete legends
Vindaar Feb 9, 2024
6b8f165
implement ~hideTitle~ as proc and feature
Vindaar Feb 9, 2024
f5c6a6f
[tests] fix merging scales test for new container viewport (dataAsBit…
Vindaar Feb 9, 2024
3c8376f
[tests] update test case for position of labels
Vindaar Feb 9, 2024
e567097
update nimble task to regenerate all plots
Vindaar Feb 9, 2024
0dcf6b1
update changelog
Vindaar Feb 9, 2024
d8c0c3d
bump datamancer dependency
Vindaar Feb 9, 2024
24a258a
disable tests for missing aesthetics
Vindaar Feb 9, 2024
7bb9a79
explicitly set `fType` in cases where none was set, update GgPlot field
Vindaar Feb 10, 2024
b719c74
handle `FileTypeKind` everywhere required
Vindaar Feb 10, 2024
78dc066
[recipes] update recipes where needed for FileTypeKind
Vindaar Feb 10, 2024
52ff846
[tests] add fType where needed in tests
Vindaar Feb 10, 2024
2f7977b
[tests] update test comparison threshold
Vindaar Feb 10, 2024
282cd30
update fkNone -> fkNull
Vindaar Feb 11, 2024
74f8b0e
[theme] set `cVal` to `used` in TOML theme logic
Vindaar Feb 11, 2024
0ab96b7
fix facet logic for refc
Vindaar Feb 11, 2024
e0a2db9
[recipes] update all plots and JSON files
Vindaar Feb 9, 2024
b74a2e8
update ginger dep to version including new FileTypeKinds
Vindaar Feb 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 94 additions & 1 deletion changelog.org
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
* v0.7.0
This release is a rather big one. The majority of features added
relates to customization of plots.
~Theme~ related improvements:
- ~baseLabelMargin~ field to adjust the default range between tick
labels and labels in cm.
- allow adjustment of plot size via ~Theme~
- adjustment of annotation font via ~Theme~
- scale grid lines via ~Theme~
- add ~themeLatex~, a very useful helper when producing PDF plots via
TikZ where the actual target is a TeX file. Its argument ~fWidth~
combined with ~width~ (in pixel), ~textWidth~ (in pt of the actual
~\textwidth~ of the LaTeX document to be inserted) it allows to
exactly specify font sizes of plots such that they match a given
size in the resulting PDF. E.g. a plot to be inserted at
~0.9\textwidth~ using ~fWidth = 0.9~, a plot size of e.g. ~width =
600~ pixel (for the standalone plot) and a ~textWidth~ of ~450 pt~
(LaTeX pt) produces a resulting PDF after inserting the plot at the
~0.9\textwidth~ that matches exactly the font sizes given by
~ggplotnim~. The ~baseTheme~ is an argument of a procedure that
returns the desired ~Theme~ to be used as a base.
- ~singlePlot~ and ~sideBySide~ are two ~baseTheme~ procedures that
produce nice looking graphs when inserting as a single or 2
side-by-side setup in a TeX file.
- add ~coord_fixed~ option that creates the actual data portion of the
plot in fixed ratio. E.g. an argument of ~1.0~ creates a plot of
user given ~width~ where the height is computed precisely such that
the data portion is of ratio 1:1. Useful for physical coordinates in
a plot to correspond to the desired ratio.
- allow setting ~useTeX~ argument via ~Theme~ (to enable/disable TikZ
backend)
- allow hiding x or y labels individually
- adjust styling of ridgeline plots
- add ~cool~ colormap
- fields ~discrete/continuousLegendWidth/Height~ fields to ~Theme~ to
adjust the size of continuous / discrete legends
- add helper to add two ~Themes~ via ~+~
- respect user set margins in facet plots
- add ~tomlTheme~ to set a theme at runtime from a TOML file. Example
given in PR description (PR #176)
- draw histograms as lines in discrete legends
- add ~hideTitle~ to disable title (among other ~hide~ procedures)

- add ~dataAsBitmap~ feature for Cairo, TikZ backend. In a vector
graphic target will draw all the actual data as a PNG, similar to in
a raster plot. This makes plots with large amounts of data as a
vector graphic feasible.
- make ~aes~ arguments to initial ~ggplot~ call optional. This of
course implies arguments to ~geom_*~ calls are mandatory. There is a
chance this is a breaking change in some contexts and decreases
CT safety to some extent. But it can be very useful when combining
different geoms that don't share column names as well as using
different aesthetics.
- add experimental (CT + RT) option ~WritePlotCsv~. If compiled with
~-d:WritePlotCsv~ and then a ~WRITE_PLOT_CSV=true~ environment
variable set, ~ggplotnim~ will write CSV files for every plot
produced. The filename is the filename of the plot with ~.csv~
suffix. For each geom that has a separate dataframe an extra CSV
file is produced. This allows for easy sharing of data that is used
to produce a plot.
- add ~TEXT_PRECISION~ environment variable check for ~geom_text~ to
adjust the precision used for floating point numbers.
- allow assignment of facets in user given order by ~order~ argument
to ~facet_wrap~
- add option ~gradient~ opposite to ~factor~ to force an aesthetic argument to
be continuous
- adjust data scale in ~scale_fill/color_continuous/gradient~ procs
- allow annotations to be placed at ~top/right~ positions in addition
to ~left/bottom~
- fixes to raster plots with other geoms resulting in bad data ranges
- better support for histograms with minimal values != 0
- use ~expandTilde~ in ~ggsave~
- improve logic detecting discreteness of arguments
- better exception message when color parsing fails
- refactoring of facet logic
- fixes to legend heights in some setups
- better date logic for non facet plots
* v0.6.3
- allow adjustment of title position in relative coordinates using
~titlePosition~
Expand All @@ -12,7 +89,23 @@
sizes etc. by a factor. Useful to effectively change the DPI of the
figure.
- add experimental ~theme_font_scale~ which acts like ~theme_scale~,
but does not adjust the base scale (related to scaling the margins)
but does not adjust the base scale (related to scaling the margins)
- allow to assign custom order in ~facet_wrap~ based on a ~order:
seq[Value]~ argument
- add new feature helping with reproducibility of plots:
If compiled with ~-d:WritePlotCsv~ ~ggplotnim~ now provides the option to automatically
write out CSV files for input DF for each plot that is created (if
enabled via environment variable ~WRITE_PLOT_CSV=true~). Also all
DFs associated with individual geoms will be written with a geom
specific suffix.
- fix ~geom_raster~ when used in conjunction with another geom that
has a larger data range
- allow adjustment of margin used by default between the tick labels
and the labels. Default is 0.3 cm, can be changed using
~baseLabelMargin~ proc / ~Theme~ field
- improve logic for histograms in the case where the minimum viewport
is not 0, which can happen for custom ~ylim~ calls (for example for
manual log10 histograms via ~stat = "identity"~)
* v0.6.2
- handle geom calls with constant values better. Previously we
sometimes ended up drawing the same e.g. text multiple times, once
Expand Down
7 changes: 4 additions & 3 deletions ggplotnim.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ srcDir = "src"

requires "nim >= 1.0.0"
requires "https://github.com/Vindaar/seqmath >= 0.1.16"
requires "ginger == 0.5.3"
requires "datamancer >= 0.3.2"
requires "ginger == 0.6.1"
requires "datamancer >= 0.4.0"
requires "arraymancer >= 0.7.22"
requires "shell >= 0.4.3"
requires "webview"
requires "parsetoml"
requires "https://github.com/SciNim/scinim >= 0.1.0"

task testCI, "Run standard tests w/o cairo dependency":
Expand Down Expand Up @@ -126,5 +127,5 @@ task generateAll, "Generate all output files (requires lualatex, inkscape)":
exec "nim c -r recipes/rTikZLandau.nim" # generate `.tex` file for Landau
exec "lualatex --shell-escape media/recipes/rTikZLandau.tex"
exec "inkscape --export-type=png --pdf-poppler rTikZLandau.pdf"
exec "mv rTikZLandau.pdf.png media/recipes/rTikZLandau.png"
exec "mv rTikZLandau.png media/recipes/rTikZLandau.png"
exec "rm rTikZLandau.pdf rTikZLandau.aux rTikZLandau.log"
Binary file modified media/expected/rAnnotateMaxValues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rAnnotateUsingGeomText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rAnnotatedHeatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rAutoColoredNeuralSpikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rAxionMassVsDensity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rAxionMassesLogLog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rBarPlotCompStats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rBarPlotRotatedLabels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rBothDiscreteAxes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rClassifiedGeomText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rColormaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCreateMarginBuffer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomAnnotations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomBreaks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomColoredNeuralSpikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomColormap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomFill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rCustomMargins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rDiscreteXLine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rDiscreteYAxis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rEnlargeXRange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rErrorBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rFacetRaster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rFacetTpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rFormatDatesPlot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/expected/rFormatDecimalsPlot.png
Binary file modified media/expected/rFormulaAesthetic.png
Binary file modified media/expected/rFreqPolyWithAlpha.png
Binary file modified media/expected/rGeomSmooth.png
Binary file modified media/expected/rHighlightMinMax.png
Binary file modified media/expected/rHistogramDensity.png
Binary file modified media/expected/rHistogramOutline.png
Binary file modified media/expected/rLimitXRange.png
Binary file modified media/expected/rLinePlotSize.png
Binary file modified media/expected/rLinearFit.png
Binary file modified media/expected/rLongTitleMultiline.png
Binary file modified media/expected/rMassAttenuationFunction.png
Binary file modified media/expected/rMpgContinuousColorPoints.png
Binary file modified media/expected/rMpgCustomColorPoint.png
Binary file modified media/expected/rMpgDiscreteXScale.png
Binary file modified media/expected/rMpgHistoBinWidth.png
Binary file modified media/expected/rMpgHistoCustomBreaks.png
Binary file modified media/expected/rMpgHistoNumBins.png
Binary file modified media/expected/rMpgHistoPlusPoints.png
Binary file modified media/expected/rMpgSimpleBarPlot.png
Binary file modified media/expected/rMpgStackedBarPlot.png
Binary file modified media/expected/rMpgStackedPointPlot.png
Binary file modified media/expected/rMultiSubplots.png
Binary file modified media/expected/rMultipleLegends.png
Binary file modified media/expected/rNegativeBarPlot.png
Binary file modified media/expected/rNewtonAcceleration.png
Binary file modified media/expected/rPeriodicTable.png
Binary file modified media/expected/rPointInPolygons.png
Binary file modified media/expected/rPrebinnedHisto.png
Binary file modified media/expected/rRidgeLineGauss.png
Binary file modified media/expected/rScaleXDate.png
Binary file modified media/expected/rSimpleFacet.png
Binary file modified media/expected/rSimpleGeomText.png
Binary file modified media/expected/rSimpleLinePlot.png
Binary file modified media/expected/rSimpleRaster.png
Binary file modified media/expected/rSimpleTile.png
Binary file added media/expected/rSimpleVegaLite.png
Binary file modified media/expected/rStackedMpgFreqpoly.png
Binary file modified media/expected/rStackedMpgHistogram.png
Binary file added media/expected/rTikZLandau.png
Binary file modified media/expected/rTwoSensorsBadStyle.png
Binary file modified media/expected/rTwoSensorsGoodStyle.png
Binary file modified media/expected/rWeightedHistogram.png
Binary file modified media/recipes/rAnnotateMaxValues.png
Binary file modified media/recipes/rAnnotateUsingGeomText.png
Binary file modified media/recipes/rAnnotatedHeatmap.png
Binary file modified media/recipes/rAutoColoredNeuralSpikes.png
Binary file modified media/recipes/rAxionMassVsDensity.png
Binary file modified media/recipes/rAxionMassesLogLog.png
Binary file modified media/recipes/rBarPlotCompStats.png
Binary file modified media/recipes/rBarPlotRotatedLabels.png
Binary file modified media/recipes/rBothDiscreteAxes.png
Binary file modified media/recipes/rClassifiedGeomText.png
Binary file modified media/recipes/rColormaps.png
Binary file modified media/recipes/rCreateMarginBuffer.png
Binary file modified media/recipes/rCustomAnnotations.png
Binary file modified media/recipes/rCustomBreaks.png
Binary file modified media/recipes/rCustomColoredNeuralSpikes.png
Binary file modified media/recipes/rCustomColormap.png
Binary file modified media/recipes/rCustomFill.png
Binary file modified media/recipes/rCustomMargins.png
Binary file modified media/recipes/rDiscreteXLine.png
Binary file modified media/recipes/rDiscreteYAxis.png
Binary file modified media/recipes/rEnlargeXRange.png
Binary file modified media/recipes/rErrorBar.png
Binary file modified media/recipes/rFacetRaster.png
Binary file modified media/recipes/rFacetTpa.png
Binary file modified media/recipes/rFormatDatesPlot.png
Binary file modified media/recipes/rFormatDecimalsPlot.png
Binary file modified media/recipes/rFormulaAesthetic.png
Binary file modified media/recipes/rFreqPolyWithAlpha.png
Binary file modified media/recipes/rGeomSmooth.png
Binary file modified media/recipes/rHighlightMinMax.png
Binary file modified media/recipes/rHistogramDensity.png
Binary file modified media/recipes/rHistogramOutline.png
Binary file modified media/recipes/rLimitXRange.png
Binary file modified media/recipes/rLinePlotSize.png
Binary file modified media/recipes/rLinearFit.png
Binary file modified media/recipes/rLongTitleMultiline.png
Binary file modified media/recipes/rMassAttenuationFunction.png
Binary file modified media/recipes/rMpgContinuousColorPoints.png
Binary file modified media/recipes/rMpgCustomColorPoint.png
Binary file modified media/recipes/rMpgDiscreteXScale.png
Binary file modified media/recipes/rMpgHistoBinWidth.png
Binary file modified media/recipes/rMpgHistoCustomBreaks.png
Binary file modified media/recipes/rMpgHistoNumBins.png
Binary file modified media/recipes/rMpgHistoPlusPoints.png
Binary file modified media/recipes/rMpgSimpleBarPlot.png
Binary file modified media/recipes/rMpgStackedBarPlot.png
Binary file modified media/recipes/rMpgStackedPointPlot.png
Binary file modified media/recipes/rMultiSubplots.png
Binary file modified media/recipes/rMultipleLegends.png
Binary file modified media/recipes/rNegativeBarPlot.png
Binary file modified media/recipes/rNewtonAcceleration.png
Binary file modified media/recipes/rPeriodicTable.png
Binary file modified media/recipes/rPointInPolygons.png
Binary file modified media/recipes/rPrebinnedHisto.png
Binary file modified media/recipes/rRidgeLineGauss.png
Binary file modified media/recipes/rScaleXDate.png
Binary file modified media/recipes/rSimpleFacet.png
Binary file modified media/recipes/rSimpleGeomText.png
Binary file modified media/recipes/rSimpleLinePlot.png
Binary file modified media/recipes/rSimpleRaster.png
Binary file modified media/recipes/rSimpleTile.png
Binary file modified media/recipes/rStackedMpgFreqpoly.png
Binary file modified media/recipes/rStackedMpgHistogram.png
Binary file modified media/recipes/rTikZLandau.png
40 changes: 24 additions & 16 deletions media/recipes/rTikZLandau.tex
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
\documentclass[tikz,border=0mm]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{unicode-math}
\usepackage{unicode-math} % for unicode support in math environments
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{booktabs}
\sisetup{mode=text,range-phrase = {\text{~to~}}, range-units=single, print-unity-mantissa=false}
\usepackage{mhchem}
\usepackage{tikz}



\begin{document}
\definecolor{backgroundColor}{rgb}{1.0, 1.0, 1.0}

Expand All @@ -20,7 +23,7 @@

\draw [color = drawColor, fill = fillColor, draw opacity = 0.0, fill opacity = 1.0, line width = 0.0bp] (0.0000bp, 480.0000bp) rectangle (640.0000bp, 0.0000bp) ;
\node [right, font=\fontsize{16.0}{19.2}\selectfont
, anchor=west] at (70.8661bp, 464.2537bp){Approximation of Landau distribution: $p(x) \approx \frac{1}{\sqrt{2π}} \exp\left(- \frac{x + e^{-x}}{2} \right)$} ;
, anchor=west] at (70.8661bp, 463.5125bp){Approximation of Landau distribution: $p(x) \approx \frac{1}{\sqrt{2π}} \exp\left(- \frac{x + e^{-x}}{2} \right)$} ;
\definecolor{drawColor}{rgb}{0.0, 0.0, 0.0}
\definecolor{fillColor}{rgb}{0.9200000166893005, 0.9200000166893005, 0.9200000166893005}

Expand All @@ -34,37 +37,37 @@
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (464.1661bp, 51.6929bp)--(464.1661bp, 56.6929bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (587.0723bp, 51.6929bp)--(587.0723bp, 56.6929bp) ;
\node [font=\fontsize{8.0}{9.6}\selectfont
] at (95.4474bp, 45.7962bp){-5} ;
] at (95.4474bp, 46.3613bp){-5} ;
\node [font=\fontsize{8.0}{9.6}\selectfont
] at (218.3536bp, 45.7962bp){0} ;
] at (218.3536bp, 46.3319bp){0} ;
\node [font=\fontsize{8.0}{9.6}\selectfont
] at (341.2598bp, 45.7962bp){5} ;
] at (341.2598bp, 46.3613bp){5} ;
\node [font=\fontsize{8.0}{9.6}\selectfont
] at (464.1661bp, 45.7962bp){10} ;
] at (464.1661bp, 46.3319bp){10} ;
\node [font=\fontsize{8.0}{9.6}\selectfont
] at (587.0723bp, 45.7962bp){15} ;
] at (587.0723bp, 46.3535bp){15} ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 56.6929bp)--(65.8661bp, 56.6929bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 135.6850bp)--(65.8661bp, 135.6850bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 214.6772bp)--(65.8661bp, 214.6772bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 293.6693bp)--(65.8661bp, 293.6693bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 372.6614bp)--(65.8661bp, 372.6614bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 451.6535bp)--(65.8661bp, 451.6535bp) ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 56.6929bp){0} ;
, anchor=east] at (63.1381bp, 56.6929bp){0} ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 135.6850bp){0.05} ;
, anchor=east] at (63.1381bp, 135.6850bp){0.05} ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 214.6772bp){0.1} ;
, anchor=east] at (63.1381bp, 214.6772bp){0.1} ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 293.6693bp){0.15} ;
, anchor=east] at (63.1381bp, 293.6693bp){0.15} ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 372.6614bp){0.2} ;
, anchor=east] at (63.1381bp, 372.6614bp){0.2} ;
\node [left, font=\fontsize{8.0}{9.6}\selectfont
, anchor=east] at (62.6394bp, 451.6535bp){0.25} ;
, anchor=east] at (63.1381bp, 451.6535bp){0.25} ;
\node [font=\fontsize{12.0}{14.4}\selectfont
] at (341.2598bp, 28.3465bp){x} ;
] at (341.2598bp, 26.2053bp){x} ;
\node [rotate = 90.0, font=\fontsize{12.0}{14.4}\selectfont
] at (33.0283bp, 254.1732bp){y} ;
] at (33.9522bp, 254.1732bp){y} ;
\definecolor{drawColor}{rgb}{1.0, 1.0, 1.0}
\definecolor{fillColor}{rgb}{0.0, 0.0, 0.0}

Expand All @@ -80,7 +83,12 @@
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 372.6614bp)--(611.6535bp, 372.6614bp) ;
\draw [color = drawColor, fill = fillColor, draw opacity = 1.0, fill opacity = 0.0, line width = 1.0bp] (70.8661bp, 451.6535bp)--(611.6535bp, 451.6535bp) ;
\node [right, rotate = -0.0, font=\fontsize{12.0}{14.4}\selectfont
, align=left] at (341.2598bp, 223.7903bp){The Landau distribution\\ \\ $p(x) = \frac{1}{2πi}\int_{a-i∞}^{a+i∞} e^{s \log(s) + xs}\, ds$\\ \\reduces to the approximation:\\ \\ $p(x) \approx \frac{1}{\sqrt{2π}} \exp\left(- \frac{x + e^{-x}}{2} \right)$\\ \\ for $μ = 0, c = 1$} ;
, anchor=south west] at (341.2598bp, 214.6772bp){
\begin{tabular}{@{}l@{}}
The Landau distribution\\\\$p(x) = \frac{1}{2πi}\int_{a-i∞}^{a+i∞} e^{s \log(s) + xs}\, ds$\\\\reduces to the approximation:\\\\$p(x) \approx \frac{1}{\sqrt{2π}} \exp\left(- \frac{x + e^{-x}}{2} \right)$\\\\for $μ = 0, c = 1$
\end{tabular}

} ;
\definecolor{drawColor}{rgb}{0.2000000029802322, 0.2000000029802322, 0.2000000029802322}
\definecolor{fillColor}{rgb}{0.0, 0.0, 0.0}

Expand Down
Binary file modified media/recipes/rTwoSensorsBadStyle.png
Binary file modified media/recipes/rTwoSensorsGoodStyle.png
Binary file modified media/recipes/rWeightedHistogram.png
6 changes: 3 additions & 3 deletions recipes.org
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ for i in 0 ..< 5:
df.add toDf({"x" : xs, "y" : i })

for scale in [viridis(), magma(), plasma(), inferno()]:
plts.add ggplot(df, aes("x", "y", fill = "x")) +
plts.add ggplot(df, aes("x", "y", fill = "x"), backend = bkCairo, fType = fkPng) +
scale_fill_gradient(scale) + # assign the correct scale
geom_raster() +
ylim(0, 5) + # due to our weird data (height deduced as 1, set correct limits)
Expand Down Expand Up @@ -1220,15 +1220,15 @@ let df = toDf({ "t" : t,
"Im x(t)" : y2 })
let plt1 = ggcreate(
ggplot(df, aes("t", "Re x(t)"),
backend = bkCairo) + # tell `ggsave` we wish to create the plot on the cairo backend
backend = bkCairo, fType = fkPng) + # tell `ggsave` we wish to create the plot on the cairo backend and as a PNG
geom_line() +
xlim(-0.02, 0.05) +
ggtitle("Real part of x(t)=e^{j 100 π t}"),
width = 800, height = 300
)
let plt2 = ggcreate(
ggplot(df, aes("t", "Im x(t)"),
backend = bkCairo) +
backend = bkCairo, fType = fkPng) +
geom_line() +
xlim(-0.02, 0.05) +
ggtitle("Imaginary part of x(t)=e^{j 100 π t}"),
Expand Down
2 changes: 1 addition & 1 deletion recipes/rColormaps.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for i in 0 ..< 5:
df.add toDf({"x" : xs, "y" : i })

for scale in [viridis(), magma(), plasma(), inferno()]:
plts.add ggplot(df, aes("x", "y", fill = "x")) +
plts.add ggplot(df, aes("x", "y", fill = "x"), backend = bkCairo, fType = fkPng) +
scale_fill_gradient(scale) + # assign the correct scale
geom_raster() +
ylim(0, 5) + # due to our weird data (height deduced as 1, set correct limits)
Expand Down
4 changes: 2 additions & 2 deletions recipes/rMultiSubplots.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ let df = toDf({ "t" : t,
"Im x(t)" : y2 })
let plt1 = ggcreate(
ggplot(df, aes("t", "Re x(t)"),
backend = bkCairo) + # tell `ggsave` we wish to create the plot on the cairo backend
backend = bkCairo, fType = fkPng) + # tell `ggsave` we wish to create the plot on the cairo backend and as a PNG
geom_line() +
xlim(-0.02, 0.05) +
ggtitle("Real part of x(t)=e^{j 100 π t}"),
width = 800, height = 300
)
let plt2 = ggcreate(
ggplot(df, aes("t", "Im x(t)"),
backend = bkCairo) +
backend = bkCairo, fType = fkPng) +
geom_line() +
xlim(-0.02, 0.05) +
ggtitle("Imaginary part of x(t)=e^{j 100 π t}"),
Expand Down
2 changes: 1 addition & 1 deletion resources/expected/rAnnotateMaxValues.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rAnnotateUsingGeomText.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rAnnotatedHeatmap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rAutoColoredNeuralSpikes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rAxionMassVsDensity.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rAxionMassesLogLog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rBarPlotCompStats.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rBarPlotRotatedLabels.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rBothDiscreteAxes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rClassifiedGeomText.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCreateMarginBuffer.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomAnnotations.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomBreaks.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomColoredNeuralSpikes.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomColormap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomFill.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rCustomMargins.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rDiscreteXLine.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rDiscreteYAxis.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rEnlargeXRange.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rErrorBar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFacetRaster.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFacetTpa.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFormatDatesPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFormatDecimalsPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFormulaAesthetic.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rFreqPolyWithAlpha.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rGeomSmooth.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rHighlightMinMax.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rHistogramDensity.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rHistogramOutline.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rJoyplot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rLimitXRange.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rLinePlotSize.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rLinearFit.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rLongTitleMultiline.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMassAttenuationFunction.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgContinuousColorPoints.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgCustomColorPoint.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgDiscreteXScale.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgHistoBinWidth.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgHistoCustomBreaks.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgHistoNumBins.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgHistoPlusPoints.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgSimpleBarPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgStackedBarPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMpgStackedPointPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rMultipleLegends.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rNegativeBarPlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rNewtonAcceleration.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rPeriodicTable.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rPointInPolygons.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rPrebinnedHisto.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rRidgeLineGauss.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rRidgeLineGaussBlack.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rScaleXDate.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rSimpleFacet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rSimpleGeomText.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rSimpleLinePlot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rSimpleRaster.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rSimpleTile.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rStackedMpgFreqpoly.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rStackedMpgHistogram.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rTwoSensorsBadStyle.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rTwoSensorsGoodStyle.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/expected/rWeightedHistogram.json

Large diffs are not rendered by default.

Loading
Loading