# A simple manual testbench for draw

## The concept

We don't have an automatic testbench for gnuplot. But we can at least run all gnuplot examples and accompy every image with the information what to check for manually.

if wxplot_size = 'wxplot_size then
    (
        print("Maxima will now try to display draw scenes and tell what they should contain."),
        print("The test if this is actually true has to be done manually, though.")
    )$

## The test cases for things that can be embedded/displayed on the screen.

print("A 3D graph without axis")$
load("../doc/info/figures/draw_axis3d.mac")$

print("A diagram without a bottom axis")$
load("../doc/info/figures/draw_axis_bottom.mac")$

print("Bars, Group B has a dashed border, if gnuplot is using pngcairo as terminal")$
load("../doc/info/figures/draw_bars.mac")$

print("Two triangles, the right one without border")$
load("../doc/info/figures/draw_border.mac")$

print("A colorful 3D plot with a legend telling which color means which Z coordinate")$
load("../doc/info/figures/draw_cbrange.mac")$

print("The same as above, but the color range ranges from \"Low\" over \"Medium\" to \"High\"")$
load("../doc/info/figures/draw_cbtics.mac")$

print("One centered label and curves with different colors")$
load("../doc/info/figures/draw_color.mac")$

print("Two clored boxes, the upper one with a legend sorting the colors from black (0) to yellow (200)")$
load("../doc/info/figures/draw_colorbox.mac")$

print("A colorful 3D diagram with the legend called \"Magnitude\"")$
load("../doc/info/figures/draw_colorbox2.mac")$

print("A plot with an ellipse (left) and a plot with a triangle (right)")$
load("../doc/info/figures/draw_columns.mac")$

print("A contour plot with height lines")$
load("../doc/info/figures/draw_contour.mac")$

print("Only the height lines seen from above")$
load("../doc/info/figures/draw_contour2.mac")$

print("A 3d cylinder")$
load("../doc/info/figures/draw_cylindrical.mac")$

print("A 3D mesh with random 3D pixels")$
load("../doc/info/figures/draw_elevation_grid.mac")$

print("A filled 3/4 circle and a quarter of a non-filled circle")$
load("../doc/info/figures/draw_ellipse.mac")$

print("A 3d diagram in grayscale; The color equals the x coordinate; black is left")$
load("../doc/info/figures/draw_enhanced3d.mac")$

print("Colorful big points in a 3D space, blue means: x=0, yellow means: x=1")$
load("../doc/info/figures/draw_enhanced3d10.mac")$

print("Colored dots, more or less chaotic colors and a color scale.")$
load("../doc/info/figures/draw_enhanced3d11.mac")$

print("A colored surface, the colors show 1/x isoclines.")$
load("../doc/info/figures/draw_enhanced3d2.mac")$

print("Parabolae in a3d space. One side of the line is black, the other yellow.")$
load("../doc/info/figures/draw_enhanced3d3.mac")$

print("A colored curve.")$
load("../doc/info/figures/draw_enhanced3d4.mac")$

print("A surface with a 1/(x*y) color pattern")$
load("../doc/info/figures/draw_enhanced3d5.mac")$

print("A gray 3d tube")$
load("../doc/info/figures/draw_enhanced3d6.mac")$

print(" colored 3d tube.")$
load("../doc/info/figures/draw_enhanced3d7.mac")$

print("A 3d tube with one closed end")$
load("../doc/info/figures/draw_enhanced3d8.mac")$

print("Two colored easter eggs.")$
load("../doc/info/figures/draw_enhanced3d9.mac")$

print("A 3d surface")$
load("../doc/info/figures/draw_equiv.mac")$

print("Two error lines with markers in the end and one marker in the middle each.")$
load("../doc/info/figures/draw_errors.mac")$

print("Two error crosses where the centers of the crosses being connected")$
load("../doc/info/figures/draw_errors2.mac")$

print("A wide parabola")$
load("../doc/info/figures/draw_explicit.mac")$

print("A filled area below a parabola")$
load("../doc/info/figures/draw_explicit2.mac")$

print("A 3d parabola and a plane that intersect each other.")$
load("../doc/info/figures/draw_explicit3.mac")$

print("The area below a sinus filled with red")$
load("../doc/info/figures/draw_filledfunc.mac")$

print("The area between two curves.")$
load("../doc/info/figures/draw_filledfunc2.mac")$

print("A plot with a background grid.")$
load("../doc/info/figures/draw_grid.mac")$

print("A plot with a fine background grid")$
load("../doc/info/figures/draw_grid2.mac")$

print("Vertical arrows with one head each")$
load("../doc/info/figures/draw_head_angle.mac")$

print("A double- and a single-headed arrow.")$
load("../doc/info/figures/draw_head_both.mac")$

print("Arrows with differently-sized heads")$
load("../doc/info/figures/draw_head_length.mac")$

print("Arrows with three head types")$
load("../doc/info/figures/draw_head_type.mac")$

print("A random bitmap and a color scale")$
load("../doc/info/figures/draw_image.mac")$

print("The same bitmap with a black-and-white palette")$
load("../doc/info/figures/draw_image2.mac")$

print("A different palette")$
load("../doc/info/figures/draw_image3.mac")$

print("Another palette")$
load("../doc/info/figures/draw_image4.mac")$

print("a 6-pixel image in color")$
load("../doc/info/figures/draw_image5.mac")$

print("And the same with a black-and-white palette")$
load("../doc/info/figures/draw_image6.mac")$

print("A typical implicit plot")$
load("../doc/info/figures/draw_implicit.mac")$

print("Two 3D easter eggs as implicit plot")$
load("../doc/info/figures/draw_implicit2.mac")$

print("A sinus and a cosinus with grid, two line styles and colors")$
load("../doc/info/figures/draw_intro.mac")$

print("A diagram with a circle and a diagram with a triangle next to each other")$
load("../doc/info/figures/draw_intro2.mac")$

print("A diagram with a sinus above a diagram with a cosinus ")$
load("../doc/info/figures/draw_intro3.mac")$

print("A 3d plot with each mesh rectangle being filled with a solid color")$
load("../doc/info/figures/draw_interpolate_color.mac")$

print("A 3d plot with smooth colors")$
load("../doc/info/figures/draw_interpolate_color2.mac")$

print("A 3d Plot with colors only smoothed in z direction.")$
load("../doc/info/figures/draw_interpolate_color3.mac")$

print("A irregular mesh with each rectangle filled with a solid color")$
load("../doc/info/figures/draw_interpolate_color4.mac")$

print("A irregular mesh with interpolated colors as an ugly example")$
load("../doc/info/figures/draw_interpolate_color5.mac")$

print("An even more ugly example of this mesh")$
load("../doc/info/figures/draw_interpolate_color6.mac")$

print("A plot with a  key")$
load("../doc/info/figures/draw_key.mac")$

print("A key at the top left")$
load("../doc/info/figures/draw_key_pos.mac")$

print("Two transparent grids")$
load("../doc/info/figures/draw_key_pos2.mac")$

print("4 horizontally centered Labels")$
load("../doc/info/figures/draw_label.mac")$

print("Labels around a 3d surface")$
load("../doc/info/figures/draw_label2.mac")$

print("Aligned labels")$
load("../doc/info/figures/draw_label_alignment.mac")$

print("Rotation of labels")$
load("../doc/info/figures/draw_label_orientation.mac")$

print("Two line types")$
load("../doc/info/figures/draw_line_type.mac")$

print("Three line widths")$
load("../doc/info/figures/draw_line_width.mac")$

print("3d plot with logarithmic color key")$
load("../doc/info/figures/draw_logcb.mac")$

print("linear x, logarighmic secondary x axis")$
load("../doc/info/figures/draw_logx_secondary.mac")$

print("A transparent 3d mesh")$
load("../doc/info/figures/draw_mesh.mac")$

print("A 3d triangle (transparent)")$
load("../doc/info/figures/draw_mesh2.mac")$

print("Two 4-point-polygons, filled with white")$
load("../doc/info/figures/draw_mesh3.mac")$

print("A curve, half smooth, half polygon")$
load("../doc/info/figures/draw_nticks.mac")$

print("Two intersecting planes in weird colors")$
load("../doc/info/figures/draw_palette.mac")$

print("Random dots, palette #1")$
load("../doc/info/figures/draw_palette2.mac")$

print("Random dots, palette #2")$
load("../doc/info/figures/draw_palette3.mac")$

print("Random dots, palette #3")$
load("../doc/info/figures/draw_palette4.mac")$

print("A 3d surface with a nonstandard palette")$
load("../doc/info/figures/draw_palette5.mac")$

print("A parametric and a normal curve")$
load("../doc/info/figures/draw_parametric.mac")$

print("A 3d surface, filled with white")$
load("../doc/info/figures/draw_parametric2.mac")$

print("A 3d slug, filled with white")$
load("../doc/info/figures/draw_parametric3.mac")$

print("Points of two sizes")$
load("../doc/info/figures/draw_point_size.mac")$

print("Point types")$
load("../doc/info/figures/draw_point_type.mac")$

print("Different point types, sometypes connected with lines")$
load("../doc/info/figures/draw_points.mac")$

print("Vertical lines of different lengths")$
load("../doc/info/figures/draw_points2.mac")$

print("Random points")$
load("../doc/info/figures/draw_points3.mac")$

print("Points at discrete y coordinates")$
load("../doc/info/figures/draw_points4.mac")$

print("Points at discrete y coordinates")$
load("../doc/info/figures/draw_points5.mac")$

print("Random points in a 3d space")$
load("../doc/info/figures/draw_points6.mac")$

print("Connected random points in a 3d space + a color key")$
load("../doc/info/figures/draw_points7.mac")$

print("Colored dots on a curve")$
load("../doc/info/figures/draw_points8.mac")$

print("Points joined by lines with different line styles")$
load("../doc/info/figures/draw_points_joined.mac")$

print("A hyperbolic spiral")$
load("../doc/info/figures/draw_polar.mac")$

print("Two polygons, one with border")$
load("../doc/info/figures/draw_polygon.mac")$

load("../doc/info/figures/draw_proportional_axis.mac")$

print("Three plots, the first two having the x axis scaled in the same scale as the y axis.")$
load("../doc/info/figures/draw_proportional_axis2.mac")$

print("A 4-point polygon")$
load("../doc/info/figures/draw_quadrilateral.mac")$

print("One filled and a non-filled rectangles, different border styles")$
load("../doc/info/figures/draw_rectangle.mac")$

load("../doc/info/figures/draw_region.mac")$

load("../doc/info/figures/draw_scene.mac")$

load("../doc/info/figures/draw_spherical.mac")$

load("../doc/info/figures/draw_surface_hide.mac")$

print("A plot with a title")$
load("../doc/info/figures/draw_title.mac")$

load("../doc/info/figures/draw_transform.mac")$

load("../doc/info/figures/draw_transform2.mac")$

print("Two triangles, one filled with transparency")$
load("../doc/info/figures/draw_transparent.mac")$

print("One triangle")$
load("../doc/info/figures/draw_triangle.mac")$

load("../doc/info/figures/draw_tube.mac")$

load("../doc/info/figures/draw_tube_extremes.mac")$

print("A few lines with heads")$
load("../doc/info/figures/draw_unit_vectors.mac")$

print("A japonese flag")$
load("../doc/info/figures/draw_user_preamble.mac")$

load("../doc/info/figures/draw_user_preamble2.mac")$

print("Vectors with different head and line styles")$
load("../doc/info/figures/draw_vector.mac")$

print("3D Vectors with wide but short heads")$
load("../doc/info/figures/draw_vector2.mac")$

load("../doc/info/figures/draw_view.mac")$

load("../doc/info/figures/draw_view2.mac")$

load("../doc/info/figures/draw_wired_surface.mac")$

load("../doc/info/figures/draw_xaxis.mac")$

load("../doc/info/figures/draw_xaxis_secondary.mac")$

load("../doc/info/figures/worldmap_make_poly_continent.mac")$

load("../doc/info/figures/worldmap_make_poly_continent2.mac")$

load("../doc/info/figures/worldmap_make_poly_country.mac")$

load("../doc/info/figures/worldmap_make_polygon.mac")$

load("../doc/info/figures/worldmap_region_boundaries.mac")$

load("../doc/info/figures/worldmap_region_boundaries_plus.mac")$

load("../doc/info/figures/draw_allocation.mac")$

load("../doc/info/figures/draw_allocation2.mac")$

load("../doc/info/figures/draw_color2.mac")$

load("../doc/info/figures/draw_xugrid.mac")$

print("A plot with primary and secondary y axis including axis titles.")$
load("../doc/info/figures/draw_ylabel_secondary.mac")$

## Test cases for file output

print("an animated gif named animated_gif.gif");
draw(
        delay     = 100,
        file_name = "animated_gif",
        terminal  = 'animated_gif,
        gr2d(explicit(x^2,x,-1,1)),
        gr2d(explicit(x^3,x,-1,1)),
        gr2d(explicit(x^4,x,-1,1)));

print("300.png and 600.png are 300x300 or 600x600 pixel png files");
draw2d(
        dimensions = [300,300],
        file_name="300",
        terminal   = 'png,
        explicit(x^4,x,-1,1)) $
draw2d(
        dimensions = [600,600],
        file_name="600",
        terminal   = 'png,
        explicit(x^4,x,-1,1)) $

print("An a4 portrait file named a4portrait.eps");
A4portrait: 100*[21, 29.7]$
draw3d(
        file_name="a4portrait",
        dimensions = A4portrait,
        terminal   = 'eps,
        explicit(x^2-y^2,x,-2,2,y,-2,2)) $

print("multipage.eps contains a multipage eps file");
draw(
        file_name = "multipage",
        terminal  = multipage_eps,
        dimensions = 100*[10,10],
        gr2d(explicit(x^2,x,-1,1)),
        gr3d(explicit(x^2+y^2,x,-1,1,y,-1,1))) $

print("A solid sine and a dashed cosine");
docdraw2d("numericLineType",
    line_type=1,
    explicit(sin(x),x,0,10),
    line_type=2,
    explicit(cos(x),x,0,10)
);