Skip to content

Commit

Permalink
updated bar plot example
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgillian committed Jan 1, 2017
1 parent 072284f commit 8af3392
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -51,5 +51,8 @@ See the specific examples directories for a full description on each example.
[Matrix Plot Example](example_matrix_plot)
![alt text](example_matrix_plot/images/matrix_plot.png "Matrix Plot Example")

[Bar Plot Example](example_bar_plot)
![alt text](example_bar_plot/images/bar_plot.png "Bar Plot Example")

##License
The ofxGRT is available under a MIT license.
24 changes: 24 additions & 0 deletions example_bar_plot/README.md
@@ -0,0 +1,24 @@
##Bar Plot Example

This example demonstrates the how to use ofxGrt Bar Plot class.

The example will generate a basic sine wave signal and plot this using the bar plot class.

![alt text](images/bar_plot.png "Bar Plot Example")

##Building and running the example
On OS X and Linux, you can build this example by running the following command in terminal:

````
cd THIS_DIRECTORY
make -j4
````

To run the example, run the following in terminal:

````
make run
````

##Using the example
To use this example, simply build and run it.
Binary file added example_bar_plot/images/bar_plot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions example_bar_plot/src/ofApp.cpp
Expand Up @@ -14,7 +14,6 @@ void ofApp::setup(){
//Setup the plot
plot1.setup( NUM_DIMENSIONS, "sine data");
plot1.setRanges( -1.0, 1.0, true );

}


Expand All @@ -33,11 +32,10 @@ void ofApp::update(){
//--------------------------------------------------------------
void ofApp::draw(){

int zoom = 5;
int plotX = 10;
int plotY = 10;
int plotW = ofGetWidth() - plotX*2;
int plotH = 100;
int plotH = ofGetHeight() - 20;

ofSetColor(255,255,255);
ofFill();
Expand All @@ -52,6 +50,16 @@ void ofApp::draw(){
//--------------------------------------------------------------
void ofApp::keyPressed(int key){

switch(key){
case 'q':
{
ofImage img;
img.grabScreen(0, 0 , ofGetWidth(), ofGetHeight());
img.save( ofToDataPath( "screenshot_" + Util::timeAsString() + ".png") );
}
break;
}

}

//--------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion example_matrix_plot/README.md
@@ -1,6 +1,6 @@
##Matrix Plot Example

This example demonstrates the how to use GRT Matrix Plot class.
This example demonstrates the how to use ofxGrt Matrix Plot class.

The example will generate three matrices, and plot them with the default grayscale plot and using a heatmap texture.

Expand Down

0 comments on commit 8af3392

Please sign in to comment.