Docstrings updated
This commit is contained in:
parent
dd97b78d2a
commit
0eecd80365
@ -15,6 +15,17 @@ fxy = [fz(x,y) for x in x, y in y]
|
|||||||
@gsp :- 2 x y fxy "w pm3d notit"
|
@gsp :- 2 x y fxy "w pm3d notit"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```julia
|
||||||
|
img = testimage("earth_apollo17");
|
||||||
|
@gp "set multiplot layout 2,2 tit 'rotate keyword (positive direction is counter-clockwise)'" :-
|
||||||
|
@gp :- "set size square" "set autoscale fix" "unset tics" "\$img"=>(img,) :-
|
||||||
|
@gp :- 1 tit="Original" "plot \$img with rgbimage notit" :-
|
||||||
|
@gp :- 2 tit="rotate=-90 deg" "plot \$img rotate=-90deg with rgbimage notit" :-
|
||||||
|
@gp :- 3 tit="rotate=0.5pi" "plot \$img rotate=0.5pi with rgbimage notit" :-
|
||||||
|
@gp :- 4 tit="rotate=180 deg" "plot \$img rotate=180deg with rgbimage notit"
|
||||||
|
```
|
||||||
|
|
||||||
## Multiple sessions
|
## Multiple sessions
|
||||||
## Named datasets
|
## Named datasets
|
||||||
## Histograms (1D)
|
## Histograms (1D)
|
||||||
|
|||||||
@ -139,24 +139,35 @@ can be replaced with a shorter version:
|
|||||||
**Gnuplot.jl** can also display images, i.e. 2D arrays:
|
**Gnuplot.jl** can also display images, i.e. 2D arrays:
|
||||||
```@example abc
|
```@example abc
|
||||||
img = randn(Float64, 30, 50)
|
img = randn(Float64, 30, 50)
|
||||||
img[10,:] .= -4
|
img[10,:] .= -5
|
||||||
@gp img "w image notit"
|
@gp img "w image notit"
|
||||||
saveas("basic7a") # hide
|
saveas("basic7a") # hide
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
Note that the first index corresponds to the `X` coordinate when the image is displayed.
|
Note that the first index in the `img` matrix corresponds to the `x` coordinate when the image is displayed.
|
||||||
|
|
||||||
The following example shows how to fix orientation of an image by means of the `using` clause (the `TestImages` package is required to run this example):
|
If the orientation is not the correct one you may adjust it with the gnuplot `rotate=` keyword (the following example requires the `TestImages` package to be installed):
|
||||||
```@example abc
|
```@example abc
|
||||||
using TestImages
|
using TestImages
|
||||||
img = testimage("lena");
|
img = testimage("lighthouse");
|
||||||
@gp "set size square" "set autoscale fix" img "u 2:(-\$1):3:4:5 with rgbimage notit"
|
@gp "set size square" "set autoscale fix" img "rotate=-90deg with rgbimage notit"
|
||||||
save(term="jpeg size 480,360", output="assets/basic7b.jpg") # hide
|
save(term="jpeg size 480,360", output="assets/basic7b.jpg") # hide
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
To display a gray image use `with image` in place of `with rgbimage`, e.g.:
|
||||||
|
```@example abc
|
||||||
|
img = testimage("walkbridge");
|
||||||
|
@gp palette(:thermal) "set size square" "set autoscale fix" img "rotate=-0.5pi with image notit"
|
||||||
|
save(term="jpeg size 480,360", output="assets/basic7c.jpg") # hide
|
||||||
|
```
|
||||||
|

|
||||||
|
Note that we used a custom palette (`:thermal`) and the rotation angle has been expressed in radians.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3D plots](@id plots3d)
|
## [3D plots](@id plots3d)
|
||||||
3D plots follow the same rules as 2D ones, just replace the `@gp` macro with `@gsp` and add the required columns (according to the plotting style).
|
3D plots follow the same rules as 2D ones, just replace the `@gp` macro with `@gsp` and add the required columns (according to the plotting style).
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user