Skip to content

Commit 7bb596e

Browse files
committed
Nicer sample plots
1 parent a36dc2b commit 7bb596e

6 files changed

+874
-1367
lines changed

A-density-and-cumulative-histogram-of-x-2-are-plotted-on-the-same-plot.svg

Lines changed: 176 additions & 440 deletions
Loading

Heat-map-pops-up-where-first-parabola-used-to-be.svg

Lines changed: 151 additions & 151 deletions
Loading

Same-histograms-but-plotted-on-two-separate-plots.svg

Lines changed: 137 additions & 397 deletions
Loading

extract_README.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def generate_plots():
3333
g1 = gp.gnuplotlib(title = 'Parabola with error bars',
3434
_with = 'xyerrorbars',
3535
hardcopy = 'parabola-with-x-y-errobars-pops-up-in-a-new-window.svg')
36-
g1.plot( x**2 * 10, np.abs(x)/10, np.abs(x)*5,
36+
g1.plot( x**2 * 10, np.abs(x)/10, np.abs(x)*25,
3737
legend = 'Parabola',
3838
tuplesize = 4 )
3939

@@ -42,6 +42,7 @@ def generate_plots():
4242
title = 'Heat map',
4343
unset = 'grid',
4444
cmds = 'set view map',
45+
square = True,
4546
_with = 'image',
4647
tuplesize = 3,
4748
hardcopy = 'Heat-map-pops-up-where-first-parabola-used-to-be.svg')
@@ -55,17 +56,26 @@ def generate_plots():
5556
z )
5657

5758
x = np.arange(1000)
58-
gp.plot( (x*x, dict(histogram=1,
59-
binwidth =10000)),
60-
(x*x, dict(histogram='cumulative', y2=1)),
59+
gp.plot( (x*x, dict(histogram= True,
60+
binwidth = 20000,
61+
legend = 'Frequency')),
62+
(x*x, dict(histogram='cumulative',
63+
legend = 'Cumulative',
64+
y2 = True )),
65+
ylabel = 'Histogram frequency',
66+
y2label = 'Cumulative sum',
67+
_set='key opaque',
6168
hardcopy = 'A-density-and-cumulative-histogram-of-x-2-are-plotted-on-the-same-plot.svg' )
6269

63-
gp.plot( (x*x, dict(histogram=1,
64-
binwidth =10000)),
65-
(x*x, dict(histogram='cumulative')),
70+
gp.plot( (x*x, dict(histogram=True,
71+
binwidth =20000,
72+
legend = 'Frequency')),
73+
(x*x, dict(histogram='cumulative',
74+
legend = 'Cumulative')),
6675
_xmin=0, _xmax=1e6,
6776
multiplot='title "multiplot histograms" layout 2,1',
68-
_set='lmargin at screen 0.05',
77+
_set=('lmargin at screen 0.05',
78+
'key opaque'),
6979
hardcopy = 'Same-histograms-but-plotted-on-two-separate-plots.svg')
7080

7181

gnuplotlib.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
g1 = gp.gnuplotlib(title = 'Parabola with error bars',
1616
_with = 'xyerrorbars')
17-
g1.plot( x**2 * 10, np.abs(x)/10, np.abs(x)*5,
17+
g1.plot( x**2 * 10, np.abs(x)/10, np.abs(x)*25,
1818
legend = 'Parabola',
1919
tuplesize = 4 )
2020
[ parabola with x,y errobars pops up in a new window ]
@@ -25,6 +25,7 @@
2525
title = 'Heat map',
2626
unset = 'grid',
2727
cmds = 'set view map',
28+
square = True,
2829
_with = 'image',
2930
tuplesize = 3)
3031
[ Heat map pops up where first parabola used to be ]
@@ -40,14 +41,21 @@
4041
4142
4243
x = np.arange(1000)
43-
gp.plot( (x*x, dict(histogram=1,
44-
binwidth =10000)),
45-
(x*x, dict(histogram='cumulative', y2=1)))
44+
gp.plot( (x*x, dict(histogram= True,
45+
binwidth = 20000,
46+
legend = 'Frequency')),
47+
(x*x, dict(histogram='cumulative',
48+
legend = 'Cumulative',
49+
y2 = True )),
50+
ylabel = 'Histogram frequency',
51+
y2label = 'Cumulative sum')
4652
[ A density and cumulative histogram of x^2 are plotted on the same plot ]
4753
48-
gp.plot( (x*x, dict(histogram=1,
49-
binwidth =10000)),
50-
(x*x, dict(histogram='cumulative')),
54+
gp.plot( (x*x, dict(histogram=True,
55+
binwidth =20000,
56+
legend = 'Frequency')),
57+
(x*x, dict(histogram='cumulative',
58+
legend = 'Cumulative')),
5159
_xmin=0, _xmax=1e6,
5260
multiplot='title "multiplot histograms" layout 2,1',
5361
_set='lmargin at screen 0.05')

0 commit comments

Comments
 (0)