![]() ![]() with_boxĪ boolean (default value %t) which sets ot not the drawing of the box. The legends are drawn under the graph (which is resized accordingly). Interactive placement with the mouse (default). The legends are drawn in the lower right-hand corner. The legends are drawn in the lower left-hand corner. The legends are drawn in the upper left-hand corner. The legends are drawn in the upper right-hand corner. Of the upper left corner of the legend box. Specify where to draw the legends this parameter may be an integerįlag (or equivalently a string flag) or a vector which gives the coordinates Integer row vector of size n (the plot styles, third parameter of plot2d) or an integer 2 x n matrix, style(1,k) contains the plot style for the kth curve and style(2,k) contains the line style (if style(1,k)>0) or mark color (if style(1,k) Starting from Scilab 5.2, it is possible to write LaTeX or MathML expression. We can plot two curves that of f(x) in red and that of g(x) in green.N vector of strings, strings(i) is the legend of the ith curve We can use the ”+r-” and ”og–” options of the plot function, so that we can distinguish the two curves f(x) = x^2 and f(x) = x^3. Line Style: “-” (Solid line/default), “–” (Dashed line), “:”(Dotted line), none (No line). Now we are going to learn how to customize the objects appearance (curves) in a plot.Ĭolor and appearance can be specified by putting indications of color and points style within quotes(” “): The default setting for the grid are: black color and dashed lines. We use xgrid function to add a grid in our plot. For this purpose, we use the gca function.Ī.y_location = “origin” function y=f( x) Now we are going learn the axes operations of an x-y plot. Legend("x^2","x^3") Handle of the current axes entity For this purpose, we use the legend function in order to print the legend associated with each curve. We can configure a legend so that we can know what curve is associated with f(x) = x^2 and what curve is associated with f(x) = x^3. Xtitle("plot of y=x^2 and y=x^3","X axis","Y axis") Xtitle ( “y=x^2”, “X axis”, “Y axis” ) function y=f( x) For this purpose, we use the xtitle function. We can configure the axes of our plot as well. We use the title function in order to configure the title of our plot. Now we are going learn the Scilab graphics features which configure the title, axes and legends of an x-y plot. Plotting of the curve on Graphics Window Titles, axes and legends The previous plot was cleared through the clf command (“clear figure“). For this we have to define two functions: y=f(x) and y=g(x).īy adding the program below, we obtain the plot of two curves, f(x)=x^2 and g(x)=x^3. Let two functions are f(x)=x^2 and g(x)=x^3. Now we are going to plot two functions on the same figure. Program on scilab editor or SciNotes function y=f( x) With the program below, we plot the curve defined by f(x)=x^2 We can produce the same plot without generating the intermediate array y. We finally use the plot function so that the data is displayed as an x-y plot. This produces the row vector y, which contains 20 entries. Using this we can get the function value at the given points. The x variable now contains a row vector with 20 entries, where the first value is equal to -5 and the last value is equal to +5. We use the linspace function in order to produce 20 values in the interval. x=linspace(a,b,n) in which a is the smallest value of variable x, b is the largest value of variable x and n is number of values calculated between a and b. We can use the linspace function in order to produce linearly spaced vectors. We begin by defining the function which is to be plotted. Scilab 2D Plots of plane curves defined by function y=f(x)įirst we are going to learn how to produce a simple x-y plot. Plot command is used to create plots in the plane(2D Plots). Scilab can produce many types of 2D plots (plots in the plane) with the plot function. Then we are going to customize the title, the legend, the objects appearance and the axes operations of our graphics. Here we are going to learn how to create Scilab 2D plots. ![]() Scilab offers many ways to create and customize various types of plots and charts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |