Comments (3)
Hello,
Just like for the Penrose backend (#54), can you provide me with:
- An example script;
- A shell command or script to generate an output file, for example an EPS or PDF?
from pandoc-plot.
Generates the PDF from input.asy
to output.pdf
with command asy -o output.pdf input.asy
or asy -outname output.pdf input.asy
.
An example script:
import graph;
size(9cm,8cm,IgnoreAspect);
string data="westnile.csv";
file in=input(data).line().csv();
string[] columnlabel=in;
real[][] A=in;
A=transpose(A);
real[] number=A[0], survival=A[1];
path g=graph(number,survival);
draw(g);
scale(true);
xaxis("Initial no.\ of mosquitoes per bird ($S_{M_0}/N_{B_0}$)",
Bottom,LeftTicks);
xaxis(Top);
yaxis("Susceptible bird survival",Left,RightTicks(trailingzero));
yaxis(Right);
real a=number[0];
real b=number[number.length-1];
real S1=0.475;
path h1=(a,S1)--(b,S1);
real M1=interp(a,b,intersect(h1,g)[0]);
real S2=0.9;
path h2=(a,S2)--(b,S2);
real M2=interp(a,b,intersect(h2,g)[0]);
labelx("$M_1$",M1);
labelx("$M_2$",M2);
draw((a,S2)--(M2,S2)--(M2,0),Dotted);
draw((a,S1)--(M1,S1)--(M1,0),dashed);
pen p=fontsize(10pt);
real y3=0.043;
path reduction=(M1,y3)--(M2,y3);
draw(reduction,Arrow,TrueMargin(0,0.5*(linewidth(Dotted)+linewidth())));
arrow(shift(-20,5)*Label(minipage("\flushleft{\begin{itemize}\item[1.]
Estimate proportion of birds surviving at end of season\end{itemize}}",100),
align=NNE),
(M1,S1),NNE,1cm,p,Arrow(NoFill));
arrow(shift(-24,5)*Label(minipage("\flushleft{\begin{itemize}\item[2.]
Read off initial mosquito abundance\end{itemize}}",80),align=NNE),
(M1,0),NE,2cm,p,Arrow(NoFill));
arrow(shift(20,0)*Label(minipage("\flushleft{\begin{itemize}\item[3.]
Determine desired bird survival for next season\end{itemize}}",90),align=SW),
(M2,S2),SW,arrowlength,p,Arrow(NoFill));
arrow(shift(8,-15)*Label(minipage("\flushleft{\begin{itemize}\item[4.]
Calculate required proportional reduction in mosquitoes\end{itemize}}",90),
align=NW),
point(reduction,0.5),NW,1.5cm,p,Arrow(NoFill));
Script taken from the Asymptote gallery: https://asymptote.sourceforge.io/gallery/2Dgraphs/westnile.asy
The Asymptote is distributed as Debian/Ubuntu package, and TeXLive package: apt-get install asymptote
.
from pandoc-plot.
Please note that while PDF, EPS, and PNG work out of the box on Debian/Ubuntu installations,
the SVG, JPG output fails due to stringent ImageMagick security policy.
from pandoc-plot.
Related Issues (20)
- Better error processing & message when output format string is in lower caps. HOT 3
- Feature Request: `override: true/false` parameter for default output format in configuration YAML HOT 3
- Feature Request: Sage support HOT 4
- Full path to executable being ignored HOT 8
- Matplotlib 'tight_bbox' ignored HOT 2
- [conda package] Please push to Pandoc 2.18 HOT 2
- Support running executables in Docker containers (namely PlantUML) HOT 3
- Add PlantUML Security Profile by Default HOT 5
- `--safe` option that only allows safe plotting options HOT 1
- Concurrency issue when generating identical graphs HOT 4
- Support Penrose diagrams HOT 2
- Support pikchr diagrams HOT 4
- Support d2 diagrams HOT 1
- Support pandoc 3.0 HOT 3
- Support SankeyMatic diagrams HOT 1
- Debugging output when subprocess errors... HOT 1
- Half-width or text-wrapped figures? HOT 4
- `--help-figure-keys` HOT 2
- Missing file for `--manual` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-plot.