forked from processing/processing-library-template-ant
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes textMode(MODEL) references to avoid problems with pdf export
Adds a new exportToPdf example
- Loading branch information
Showing
8 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
import processing.pdf.*; | ||
import grafica.*; | ||
|
||
GPlot plot; | ||
|
||
void setup() { | ||
size(500, 350, PDF, "graficaPlot.pdf"); | ||
textMode(SHAPE); | ||
|
||
// Prepare the points for the plot | ||
int nPoints = 100; | ||
GPointsArray points = new GPointsArray(nPoints); | ||
|
||
for (int i = 0; i < nPoints; i++) { | ||
points.add(i, 10*noise(0.1*i)); | ||
} | ||
|
||
// Create a new plot and set its position on the screen | ||
plot = new GPlot(this); | ||
plot.setPos(25, 25); | ||
// or all in one go | ||
// plot = new GPlot(this, 25, 25); | ||
|
||
// Set the plot title and the axis labels | ||
plot.setTitleText("A very simple example"); | ||
plot.getXAxis().setAxisLabelText("x axis"); | ||
plot.getYAxis().setAxisLabelText("y axis"); | ||
|
||
// Add the points | ||
plot.setPoints(points); | ||
} | ||
|
||
void draw(){ | ||
background(150); | ||
|
||
// Draw it! | ||
plot.defaultDraw(); | ||
exit(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters