ExportPlot (file,type)
ExportPlot (file)
Εξάγει τα περιεχόμενα του παραθύρου γραφικής παράστασης σε αρχείο. Ο τύπος είναι μια συμβολοσειρά που καθορίζει τον τύπο αρχείου για χρήση, "png", "eps", ή "ps". Αν ο τύπος δεν ορίζεται, τότε παίρνεται η επέκταση, οπότε η επέκταση πρέπει να είναι ".png", ".eps", ή ".ps".
Σημειώστε ότι τα αρχεία αντικαθίστανται χωρίς ερώτηση.
Σε πετυχημένη εξαγωγή, επιστρέφεται αληθές. Αλλιώς, εκτυπώνεται σφάλμα και εγείρεται εξαίρεση.
Παραδείγματα:
genius>
ExportPlot("file.png")
genius>
ExportPlot("/directory/file","eps")
Version 1.0.16 onwards.
LinePlot (func1,func2,func3,...)
LinePlot (func1,func2,func3,x1,x2)
LinePlot (func1,func2,func3,x1,x2,y1,y2)
LinePlot (func1,func2,func3,[x1,x2])
LinePlot (func1,func2,func3,[x1,x2,y1,y2])
Σχεδιάστε μια συνάρτηση (ή αρκετές συναρτήσεις) με μια γραμμή. Πρώτα (μέχρι 10) ορίσματα είναι συναρτήσεις, έπειτα μπορείτε προαιρετικά να ορίσετε τα όρια του παραθύρου σχεδίασης ως x1
, x2
, y1
, y2
. Αν τα όρια δεν ορίζονται, τότε εφαρμόζονται τα τρέχοντα ορισμένα όρια (Δείτε LinePlotWindow
) Αν τα όρια y δεν ορίζονται, τότε οι συναρτήσεις υπολογίζονται και έπειτα χρησιμοποιούνται τα μέγιστα και ελάχιστα.
Η παράμετρος LinePlotDrawLegends
ελέγχει τη σχεδίαση του υπομνήματος.
Παραδείγματα:
genius>
LinePlot(sin,cos)
genius>
LinePlot(`(x)=x^2,-1,1,0,1)
LinePlotClear ()
Εμφανίζει το παράθυρο σχεδίασης γραμμής και καθαρίζει τις συναρτήσεις και οποιαδήποτε άλλη γραμμή σχεδιάστηκε.
LinePlotCParametric (func,...)
LinePlotCParametric (func,t1,t2,tinc)
LinePlotCParametric (func,t1,t2,tinc,x1,x2,y1,y2)
Σχεδιάζει μια παραμετρική μιγαδική συνάρτηση με μια γραμμή. Πρώτα έρχεται η συνάρτηση που επιστρέφει x+iy
, έπειτα προαιρετικά τα όρια t
ως t1,t2,tinc
, στη συνέχεια προαιρετικά τα όρια ως x1,x2,y1,y2
.
Αν τα όρια δεν καθορίζονται, τότε εφαρμόζονται τα τρέχοντα όρια (Δείτε LinePlotWindow
). Αν δίνεται η συμβολοσειρά "fit" για τα όρια x και y, τότε τα όρια είναι η μέγιστη έκταση του γραφήματος.
Η παράμετρος LinePlotDrawLegends
ελέγχει τη σχεδίαση του υπομνήματος.
LinePlotDrawLine (x1,y1,x2,y2,...)
LinePlotDrawLine (v,...)
Draw a line from x1
,y1
to
x2
,y2
.
x1
,y1
,
x2
,y2
can be replaced by an
n
by 2 matrix for a longer polyline.
Alternatively the vector v
may be a column vector of complex numbers,
that is an n
by 1 matrix and each complex number is then
considered a point in the plane.
Extra parameters can be added to specify line color, thickness,
arrows, the plotting window, or legend.
You can do this by adding an argument string "color"
,
"thickness"
,
"window"
,
"arrow"
, or "legend"
, and after it specify
the color, the thickness, the window
as 4-vector, type of arrow, or the legend. (Arrow and window are from version 1.0.6 onwards.)
If the line is to be treated as a filled polygon, filled with the given color, you
can specify the argument "filled"
. Since version 1.0.22 onwards.
The color should be either a string indicating the common English word for the color
that GTK will recognize such as
"red"
, "blue"
, "yellow"
, etc...
Alternatively the color can be specified in RGB format as
"#rgb"
, "#rrggbb"
, or
"#rrrrggggbbbb"
, where the r, g, or b are hex digits of the red, green, and blue
components of the color. Finally, since version 1.0.18, the color
can also be specified as a real vector specifying the red green and
blue components where the components are between 0 and 1, e.g. [1.0,0.5,0.1]
.
Το παράθυρο πρέπει να δίνεται ως συνήθως σαν [x1,x2,y1,y2]
, ή εναλλακτικά μπορεί να δοθεί ως μια συμβολοσειρά "fit"
οπότε, η περιοχή x θα οριστεί ακριβώς και η περιοχή y θα οριστεί με περιγράμματα πέντε τοις εκατό γύρω από τη γραμμή.
Η προδιαγραφή του βέλους πρέπει να είναι "origin"
, "end"
, "both"
, ή "none"
.
Στο τέλος, το υπόμνημα πρέπει να είναι μια συμβολοσειρά που μπορεί να χρησιμοποιηθεί ως υπόμνημα στο γράφημα. Δηλαδή, αν εκτυπωθούν τα υπομνήματα.
Examples:
genius>
LinePlotDrawLine(0,0,1,1,"color","blue","thickness",3)
genius>
LinePlotDrawLine([0,0;1,-1;-1,-1])
genius>
LinePlotDrawLine([0,0;1,1],"arrow","end")
genius>
LinePlotDrawLine(RungeKuttaFull(`(x,y)=y,0,0.001,10,100),"color","blue","legend","The Solution")
genius>
for r=0.0 to 1.0 by 0.1 do LinePlotDrawLine([0,0;1,r],"color",[r,(1-r),0.5],"window",[0,1,0,1])
genius>
LinePlotDrawLine([0,0;10,0;10,10;0,10],"filled","color","green")
Unlike many other functions that do not care if they take a column or a row vector, if specifying points as a vector of complex values, due to possible ambiguities, it must always be given as a column vector.
Specifying v
as a column vector of complex numbers is
implemented from version 1.0.22 and onwards.
LinePlotDrawPoints (x,y,...)
LinePlotDrawPoints (v,...)
Draw a point at x
,y
.
The input can be an n
by 2 matrix
for n
different points. This function has essentially the same
input as LinePlotDrawLine.
Alternatively the vector v
may be a column vector of complex numbers,
that is an n
by 1 matrix and each complex number is then
considered a point in the plane.
Extra parameters can be added to specify color, thickness,
the plotting window, or legend.
You can do this by adding an argument string "color"
,
"thickness"
,
"window"
,
or "legend"
, and after it specify
the color, the thickness, the window
as 4-vector, or the legend.
The color should be either a string indicating the common English word for the color
that GTK will recognize such as
"red"
, "blue"
, "yellow"
, etc...
Alternatively the color can be specified in RGB format as
"#rgb"
, "#rrggbb"
, or
"#rrrrggggbbbb"
, where the r, g, or b are hex digits of the red, green, and blue
components of the color. Finally the color can also be specified as a real vector specifying the red green
and blue components where the components are between 0 and 1.
Το παράθυρο πρέπει να δίνεται ως συνήθως σαν [x1,x2,y1,y2]
, ή εναλλακτικά μπορεί να δοθεί ως μια συμβολοσειρά "fit"
οπότε, η περιοχή x θα οριστεί ακριβώς και η περιοχή y θα οριστεί με περιγράμματα πέντε τοις εκατό γύρω από τη γραμμή.
Στο τέλος, το υπόμνημα πρέπει να είναι μια συμβολοσειρά που μπορεί να χρησιμοποιηθεί ως υπόμνημα στο γράφημα. Δηλαδή, αν εκτυπωθούν τα υπομνήματα.
Examples:
genius>
LinePlotDrawPoints(0,0,"color","blue","thickness",3)
genius>
LinePlotDrawPoints([0,0;1,-1;-1,-1])
genius>
LinePlotDrawPoints(RungeKuttaFull(`(x,y)=y,0,0.001,10,100),"color","blue","legend","The Solution")
genius>
LinePlotDrawPoints([1;1+1i;1i;0],"thickness",5)
genius>
LinePlotDrawPoints(ApplyOverMatrix((0:6)',`(k)=exp(k*2*pi*1i/7)),"thickness",3,"legend","The 7th roots of unity")
Unlike many other functions that do not care if they take a
column or a row vector, if specifying points as a vector of
complex values, due to possible ambiguities, it must always
be given as a column vector. Therefore, notice in the
last example the transpose of the vector 0:6
to make it into a column vector.
Available from version 1.0.18 onwards. Specifying
v
as a column vector of complex numbers is
implemented from version 1.0.22 and onwards.
LinePlotMouseLocation ()
Returns a row vector of a point on the line plot corresponding to
the current mouse location. If the line plot is not visible,
then prints an error and returns null
.
In this case you should run
LinePlot
or
LinePlotClear
to put the graphing window into the line plot mode.
See also
LinePlotWaitForClick
.
LinePlotParametric (xfunc,yfunc,...)
LinePlotParametric (xfunc,yfunc,t1,t2,tinc)
LinePlotParametric (xfunc,yfunc,t1,t2,tinc,x1,x2,y1,y2)
LinePlotParametric (xfunc,yfunc,t1,t2,tinc,[x1,x2,y1,y2])
LinePlotParametric (xfunc,yfunc,t1,t2,tinc,"fit")
Σχεδιάζει μια παραμετρική συνάρτηση με μια γραμμή. Πρώτα έρχονται οι συναρτήσεις για x
και y
, έπειτα προαιρετικά τα όρια του t
ως t1,t2,tinc
, έπειτα προαιρετικά τα όρια ως x1,x2,y1,y2
.
Αν δεν ορίζονται τα όρια x και y, τότε εφαρμόζονται τα τρέχοντα όρια (Δείτε LinePlotWindow
). Αν δίνεται η συμβολοσειρά "fit" για τα όρια x και y, τότε τα όρια είναι η μέγιστη έκταση του γραφήματος.
Η παράμετρος LinePlotDrawLegends
ελέγχει τη σχεδίαση του υπομνήματος.
LinePlotWaitForClick ()
If in line plot mode, waits for a click on the line plot window
and returns the location of the click as a row vector.
If the window is closed
the function returns immediately with null
.
If the window is not in line plot mode, it is put in it and shown
if not shown.
See also
LinePlotMouseLocation
.
PlotCanvasFreeze ()
Προσωρινό πάγωμα σχεδίασης του καμβά. Χρήσιμο αν χρειάζεστε να σχεδιάσετε μια ομάδα στοιχείων και θέλετε να καθυστερήσετε τη σχεδίαση όλων για να αποφύγετε τρεμόσβησμα σε μια κίνηση. Αφού έχουν σχεδιαστεί όλα θα πρέπει να καλέσετε PlotCanvasThaw
.
Ο καμβάς ξεπαγώνει πάντα μετά το τέλος οποιασδήποτε εκτέλεσης, έτσι δεν θα παραμείνει ποτέ παγωμένος. Τη στιγμή που μια νέα γραμμή εντολών εμφανίζεται για παράδειγμα, ο καμβάς σχεδίασης ξεπαγώνει αυτόματα. Σημειώστε επίσης ότι οι κλήσεις για πάγωμα και ξεπάγωμα μπορούν με ασφάλεια να εντεθούν.
Version 1.0.18 onwards.
PlotCanvasThaw ()
Thaw the plot canvas frozen by
PlotCanvasFreeze
and redraw the canvas immediately. The canvas is also always thawed after end of execution
of any program.
Version 1.0.18 onwards.
PlotWindowPresent ()
Show and raise the plot window, creating it if necessary. Normally the window is created when one of the plotting functions is called, but it is not always raised if it happens to be below other windows. So this function is good to call in scripts where the plot window might have been created before, and by now is hidden behind the console or other windows.
Version 1.0.19 onwards.
SlopefieldClearSolutions ()
Καθαρίζει τις σχεδιασμένες λύσεις από τη συνάρτηση SlopefieldDrawSolution
.
SlopefieldDrawSolution (x, y, dx)
Όταν μια γραφική παράσταση πεδίου κλίσης είναι ενεργή, σχεδιάστε μια λύση με την καθορισμένη αρχική συνθήκη. Η τυπική μέθοδος Ρούνγκε-Κούτα χρησιμοποιείται με αύξηση dx
. Οι λύσεις μένουν στο γράφημα μέχρι να εμφανιστεί μια διαφορετική γραφική παράσταση ή μέχρι να καλέσετε SlopefieldClearSolutions
. Μπορείτε επίσης να χρησιμοποιήσετε τη γραφική διεπαφή για να σχεδιάσετε λύσεις και να ορίσετε αρχικές συνθήκες με το ποντίκι.
SlopefieldPlot (func)
SlopefieldPlot (func,x1,x2,y1,y2)
Σχεδιάστε ένα πεδίο κλίσης. Η συνάρτηση func
πρέπει να πάρει δύο πραγματικούς αριθμούς x
και y
, ή έναν απλό μιγαδικό αριθμό. Προαιρετικά, μπορείτε να ορίσετε τα όρια του παραθύρου σχεδίασης ως x1
, x2
, y1
, y2
. Αν τα όρια δεν καθορίζονται, τότε τα τρέχοντα ορισμένα όρια εφαρμόζονται (Δείτε LinePlotWindow
).
Η παράμετρος LinePlotDrawLegends
ελέγχει τη σχεδίαση του υπομνήματος.
Examples:
genius>
SlopefieldPlot(`(x,y)=sin(x-y),-5,5,-5,5)
SurfacePlot (func)
SurfacePlot (func,x1,x2,y1,y2,z1,z2)
SurfacePlot (func,x1,x2,y1,y2)
SurfacePlot (func,[x1,x2,y1,y2,z1,z2])
SurfacePlot (func,[x1,x2,y1,y2])
Σχεδιάστε μια συνάρτηση επιφάνειας που παίρνει είτε δύο ορίσματα ή έναν μιγαδικό αριθμό. Πρώτα έρχεται η συνάρτηση, έπειτα προαιρετικά τα όρια ως x1
, x2
, y1
, y2
, z1
, z2
. Αν τα όρια δεν καθορίζονται, τότε εφαρμόζονται τα τρέχοντα ορισμένα όρια (Δείτε SurfacePlotWindow
). Η Genius μπορεί να σχεδιάσει μόνο μια μοναδική συνάρτηση επιφάνειας τη φορά.
Αν τα όρια Z δεν καθορίζονται, τότε χρησιμοποιούνται τα μέγιστα και ελάχιστα της συνάρτησης.
Παραδείγματα:
genius>
SurfacePlot(|sin|,-1,1,-1,1,0,1.5)
genius>
SurfacePlot(`(x,y)=x^2+y,-1,1,-1,1,-2,2)
genius>
SurfacePlot(`(z)=|z|^2,-1,1,-1,1,0,2)
SurfacePlotClear ()
Show the surface plot window and clear out functions and any other lines that were drawn.
Available in version 1.0.19 and onwards.
SurfacePlotData (data)
SurfacePlotData (data,label)
SurfacePlotData (data,x1,x2,y1,y2,z1,z2)
SurfacePlotData (data,label,x1,x2,y1,y2,z1,z2)
SurfacePlotData (data,[x1,x2,y1,y2,z1,z2])
SurfacePlotData (data,label,[x1,x2,y1,y2,z1,z2])
Plot a surface from data. The data is an n by 3 matrix whose rows are the x, y and z coordinates. The data can also be simply a vector whose length is a multiple of 3 and so contains the triples of x, y, z. The data should contain at least 3 points.
Προαιρετικά μπορούμε να δώσουμε την ετικέτα και επίσης τα όρια. Αν δεν δίνονται τα όρια, υπολογίζονται από τα δεδομένα, το SurfacePlotWindow
δεν χρησιμοποιείται, αν θέλετε να το χρησιμοποιήσετε, περάστε το ρητά. Αν δεν δίνεται η ετικέτα, τότε χρησιμοποιείται η κενή ετικέτα.
Παραδείγματα:
genius>
SurfacePlotData([0,0,0;1,0,1;0,1,1;1,1,3])
genius>
SurfacePlotData(data,"My data")
genius>
SurfacePlotData(data,-1,1,-1,1,0,10)
genius>
SurfacePlotData(data,SurfacePlotWindow)
Ιδού ένα παράδειγμα πώς να σχεδιάσετε σε πολικές συντεταγμένες, ιδιαίτερα πώς να σχεδιάσετε τη συνάρτηση -r^2 * theta
:
genius>
d:=null; for r=0 to 1 by 0.1 do for theta=0 to 2*pi by pi/5 do d=[d;[r*cos(theta),r*sin(theta),-r^2*theta]];
genius>
SurfacePlotData(d)
Version 1.0.16 onwards.
SurfacePlotDataGrid (data,[x1,x2,y1,y2])
SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2])
SurfacePlotDataGrid (data,[x1,x2,y1,y2],label)
SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2],label)
Σχεδιάστε μια επιφάνεια από κανονικά δεδομένα ορθογωνίου. Τα δεδομένα δίνεται σε έναν πίνακα n επί m, όπου οι γραμμές είναι η συντεταγμένη x και οι στήλες είναι η συντεταγμένη y. Η συντεταγμένη x διαιρείται σε ίσα n-1 υποδιαστήματα και η συντεταγμένη y διαιρείται σε ίσα m-1 υποδιαστήματα. Τα όρια x1
και x2
δίνουν το διάστημα στον άξονα x που χρησιμοποιούμε, ενώ τα όρια y1
και y2
δίνουν το διάστημα στον άξονα y που χρησιμοποιούμε. Αν τα όρια z1
και z2
δεν δίνονται, υπολογίζονται από τα δεδομένα (για να είναι οι ακραίες τιμές από τα δεδομένα).
Προαιρετικά, μπορούμε να δώσουμε την ετικέτα. Αν η ετικέτα δεν δίνεται, τότε χρησιμοποιείται η κενή ετικέτα.
Examples:
genius>
SurfacePlotDataGrid([1,2;3,4],[0,1,0,1])
genius>
SurfacePlotDataGrid(data,[-1,1,-1,1],"My data")
genius>
d:=null; for i=1 to 20 do for j=1 to 10 do d@(i,j) = (0.1*i-1)^2-(0.1*j)^2;
genius>
SurfacePlotDataGrid(d,[-1,1,0,1],"half a saddle")
Version 1.0.16 onwards.
SurfacePlotDrawLine (x1,y1,z1,x2,y2,z2,...)
SurfacePlotDrawLine (v,...)
Draw a line from x1
,y1
,z1
to
x2
,y2
,z2
.
x1
,y1
,z1
,
x2
,y2
,z2
can be replaced by an
n
by 3 matrix for a longer polyline.
Extra parameters can be added to specify line color, thickness,
the plotting window, or legend.
You can do this by adding an argument string "color"
,
"thickness"
,
"window"
,
or "legend"
, and after it specify
the color, the thickness, the window
as 6-vector, or the legend.
The color should be either a string indicating the common English word for the color
that GTK will recognize such as
"red"
, "blue"
, "yellow"
, etc...
Alternatively the color can be specified in RGB format as
"#rgb"
, "#rrggbb"
, or
"#rrrrggggbbbb"
, where the r, g, or b are hex digits of the red, green, and blue
components of the color. Finally, since version 1.0.18, the color
can also be specified as a real vector specifying the red green and
blue components where the components are between 0 and 1, e.g. [1.0,0.5,0.1]
.
The window should be given as usual as [x1,x2,y1,y2,z1,z2]
, or
alternatively can be given as a string
"fit"
in which case,
the x range will be set precisely and the y range will be set with
five percent borders around the line.
Στο τέλος, το υπόμνημα πρέπει να είναι μια συμβολοσειρά που μπορεί να χρησιμοποιηθεί ως υπόμνημα στο γράφημα. Δηλαδή, αν εκτυπωθούν τα υπομνήματα.
Examples:
genius>
SurfacePlotDrawLine(0,0,0,1,1,1,"color","blue","thickness",3)
genius>
SurfacePlotDrawLine([0,0,0;1,-1,2;-1,-1,-3])
Available from version 1.0.19 onwards.
SurfacePlotDrawPoints (x,y,z,...)
SurfacePlotDrawPoints (v,...)
Draw a point at x
,y
,z
.
The input can be an n
by 3 matrix
for n
different points. This function has essentially the same
input as SurfacePlotDrawLine.
Extra parameters can be added to specify line color, thickness,
the plotting window, or legend.
You can do this by adding an argument string "color"
,
"thickness"
,
"window"
,
or "legend"
, and after it specify
the color, the thickness, the window
as 6-vector, or the legend.
The color should be either a string indicating the common English word for the color
that GTK will recognize such as
"red"
, "blue"
, "yellow"
, etc...
Alternatively the color can be specified in RGB format as
"#rgb"
, "#rrggbb"
, or
"#rrrrggggbbbb"
, where the r, g, or b are hex digits of the red, green, and blue
components of the color. Finally the color can also be specified as a real vector specifying the red green
and blue components where the components are between 0 and 1.
The window should be given as usual as [x1,x2,y1,y2,z1,z2]
, or
alternatively can be given as a string
"fit"
in which case,
the x range will be set precisely and the y range will be set with
five percent borders around the line.
Στο τέλος, το υπόμνημα πρέπει να είναι μια συμβολοσειρά που μπορεί να χρησιμοποιηθεί ως υπόμνημα στο γράφημα. Δηλαδή, αν εκτυπωθούν τα υπομνήματα.
Examples:
genius>
SurfacePlotDrawPoints(0,0,0,"color","blue","thickness",3)
genius>
SurfacePlotDrawPoints([0,0,0;1,-1,2;-1,-1,1])
Available from version 1.0.19 onwards.
VectorfieldClearSolutions ()
Καθαρίζει τις σχεδιασμένες λύσεις από τη συνάρτηση VectorfieldDrawSolution
.
Version 1.0.6 onwards.
VectorfieldDrawSolution (x, y, dt, tlen)
Όταν ένα πεδίο διανύσματος είναι ενεργό, σχεδιάστε μια λύση με την καθορισμένη αρχική συνθήκη. Η τυπική μέθοδος Ρούνγκε-Κούτα χρησιμοποιείται με αύξηση dt
για ένα διάστημα μήκους tlen
.. Οι λύσεις μένουν στο γράφημα μέχρι να εμφανιστεί μια διαφορετική γραφική παράσταση ή μέχρι να καλέσετε VectorfieldClearSolutions
. Μπορείτε επίσης να χρησιμοποιήσετε τη γραφική διεπαφή για να σχεδιάσετε λύσεις και να ορίσετε αρχικές συνθήκες με το ποντίκι.
Version 1.0.6 onwards.
VectorfieldPlot (funcx, funcy)
VectorfieldPlot (funcx, funcy, x1, x2, y1, y2)
Σχεδιάστε ένα δισδιάστατο διανυσματικό πεδίο. Η συνάρτηση funcx
πρέπει να είναι η dx/dt του διανυσματικού πεδίου και η συνάρτηση funcy
πρέπει να είναι η dy/dt του διανυσματικού πεδίου. Οι συναρτήσεις πρέπει να παίρνουν δύο πραγματικούς αριθμούς x
και y
, ή έναν μοναδικό μιγαδικό αριθμό. Όταν η παράμετρος VectorfieldNormalized
είναι true
, τότε το μέγεθος των διανυσμάτων είναι κανονικοποιημένο. Δηλαδή, εμφανίζεται μόνο η κατεύθυνση και όχι το μέγεθος.
Προαιρετικά, μπορείτε να ορίσετε τα όρια του παραθύρου σχεδίασης ως x1
, x2
, y1
, y2
. Αν δεν καθορίζονται τα όρια, τότε εφαρμόζονται τα τρέχοντα όρια (Δείτε LinePlotWindow
).
Η παράμετρος LinePlotDrawLegends
ελέγχει τη σχεδίαση του υπομνήματος.
Παραδείγματα:
genius>
VectorfieldPlot(`(x,y)=x^2-y, `(x,y)=y^2-x, -1, 1, -1, 1)