Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dkogan/gnuplotlib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8c000368c5afcb7bdc8b11faa00bdc466007aec7
Choose a base ref
..
head repository: dkogan/gnuplotlib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a36dc2b88229f83da14fd1c87de6791acc7d2496
Choose a head ref
Showing with 18 additions and 0 deletions.
  1. +12 −0 README.org
  2. +6 −0 extract_README.py
12 changes: 12 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -12,15 +12,19 @@ import gnuplotlib as gp

x = np.arange(101) - 50
gp.plot(x**2)
#+END_SRC
[[file:basic-parabola-plot-pops-up.svg]]
#+BEGIN_SRC python


g1 = gp.gnuplotlib(title = 'Parabola with error bars',
_with = 'xyerrorbars')
g1.plot( x**2 * 10, np.abs(x)/10, np.abs(x)*5,
legend = 'Parabola',
tuplesize = 4 )
#+END_SRC
[[file:parabola-with-x-y-errobars-pops-up-in-a-new-window.svg]]
#+BEGIN_SRC python


x,y = np.ogrid[-10:11,-10:11]
@@ -30,7 +34,9 @@ gp.plot( x**2 + y**2,
cmds = 'set view map',
_with = 'image',
tuplesize = 3)
#+END_SRC
[[file:Heat-map-pops-up-where-first-parabola-used-to-be.svg]]
#+BEGIN_SRC python


theta = np.linspace(0, 6*np.pi, 200)
@@ -39,22 +45,28 @@ g2 = gp.gnuplotlib(_3d = True)
g2.plot( np.cos(theta),
np.vstack((np.sin(theta), -np.sin(theta))),
z )
#+END_SRC
[[file:Two-3D-spirals-together-in-a-new-window.svg]]
#+BEGIN_SRC python


x = np.arange(1000)
gp.plot( (x*x, dict(histogram=1,
binwidth =10000)),
(x*x, dict(histogram='cumulative', y2=1)))
#+END_SRC
[[file:A-density-and-cumulative-histogram-of-x-2-are-plotted-on-the-same-plot.svg]]
#+BEGIN_SRC python

gp.plot( (x*x, dict(histogram=1,
binwidth =10000)),
(x*x, dict(histogram='cumulative')),
_xmin=0, _xmax=1e6,
multiplot='title "multiplot histograms" layout 2,1',
_set='lmargin at screen 0.05')
#+END_SRC
[[file:Same-histograms-but-plotted-on-two-separate-plots.svg]]
#+BEGIN_SRC python
#+END_SRC

* DESCRIPTION
6 changes: 6 additions & 0 deletions extract_README.py
Original file line number Diff line number Diff line change
@@ -154,7 +154,13 @@ def write(s, verbatim):
tag = re.sub(r'[^a-zA-Z0-9_]+','-', tag)
plot_filename = f"{tag}.svg"
if os.path.isfile(plot_filename):
if in_quote is not None:
if in_quote == 'example': f.write('#+END_EXAMPLE\n')
else: f.write('#+END_SRC\n')
f.write(f"[[file:{plot_filename}]]\n")
if in_quote is not None:
if in_quote == 'example': f.write('#+BEGIN_EXAMPLE\n')
else: f.write('#+BEGIN_SRC python\n')
continue

# handle links