4/6/2024 0 Comments Conda install cairoIt resembles the built-in graphics available within MATLAB. Now, we will define the points and draw a line through those points − julia> x0=61.2 y0=74.0 julia> x1=214.8 y1=125.4 julia> x2=317.2 y2=22.8 julia> x3=470.8 圓=74.0 julia> move_to(cr, x0, y0) julia> curve_to(cr, x1, y1, x2, y2, x3, 圓) julia> set_line_width(cr, 10.0) julia> stroke_preserve(cr) julia> restore(cr) įinally, writing the resulting graphics to the disk − julia> move_to(cr, 12.0, 12.0) julia> set_source_rgb(cr, 0, 0, 0) julia> show_text(cr,"Line_Figure")julia> write_to_png(c,"Line_Figure.png") Output Text Plotting with Winston Now, we will add a rectangle − julia> set_source_rgb(cr, 0.5, 0.5, 0.5) julia> rectangle(cr, 0.0, 0.0, 512.0, 128.0) julia> fill(cr) julia> restore(cr) julia> save(cr) julia> using Cairojulia> img = CairoRGBSurface(512, 128) julia> img = CairoRGBSurface(512, 128) julia> cr = CairoContext(img) julia> save(cr) The following is an example to draw a line −įirst, we will create a cr context. It works with Linux, Windows, OS X and can create disk files in PDF, PostScript, and SVG formats also. Text Plotting with CairoĬairo, a 2D graphics library, implements a device context to the display system. This chapter discusses how to plot, visualize and perform other (graphic) operations on data using various tools in Julia.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |