# Plot graph with x/y cordinate?

Is it posible to plot graph on PC with x/y cordinate? Everything i found on internet plot y axis and x axis is always time. I need to determined both x and y cordinate than plot it

Sure, if you have Excel or an equivalent. What does this have to do with Arduino?

You can use parametric equations to move time off the axis and track 2 separate variables and still plot the time element.

If you just want to throw pairs of (x,y) on a graph, you just need to use the right kind of graph. It's easy. Tell us what program you're using, how old you are, and in simple language what it is you expect the end product to look like.

Consider installing SciDAVis. It's free and has many features.

Python, matplotlib...

INTP:
You can use parametric equations to move time off the axis and track 2 separate variables and still plot the time element.

If you just want to throw pairs of (x,y) on a graph, you just need to use the right kind of graph. It’s easy. Tell us what program you’re using, how old you are, and in simple language what it is you expect the end product to look like.

I am using arduino IDE, have 23 years old, and this is how graph should like

y axis is horsepower and x axis is RPM

arduino will send (x,y) cordinate every 0.1 sec

vaj4088:
Sure, if you have Excel or an equivalent. What does this have to do with Arduino?

I want to be real time, excel can print it after he gets full log

Years ago, I used a free program called StampPlot Pro, a quick Google shows it is still available for Windows: http://www.selmaware.com/stampplot/

Were I going to do this sort of thing today, I would likely just use Processing to perform the PC effort. This is an overview: https://www.arduino.cc/en/Tutorial/Graph

Of course, one could just connect a nice, inexpensive LCD to the Ardino and plot in that manner ... logging could be to SD if one really wanted recorded history. http://www.hackster.io/rayburne/color-barometric-extension-to-gps-date-time-clock

Or, one can use Excel as mentioned previously and with a little VBA help, you define your input range, graph, and the USB keyboard simulated data will always stay in a specified range. The basics are here: http://www.hackster.io/rayburne/arduino-to-excel-using-v-usb The above works particularly well with the 32U4 Micro running in keyboard emulation.

Ray

In the H-bomb to kill an ant scenario, there is NI's diadem.

Or even LabView.

any desire to have a display connected to the arduino and plot directly to the display?

like this?

If you want it to graph in real time that you can see, you'll need to figure out a display but that may be too much for the Arduino and still give you accurate readings. A second processor would be better since you want a graphical output that you prob want to save as an image. Arduino can print the real time readings numerically to serial and you can feed that into a computer to graph. That software you need to find or write. A Pi might be able to do it all in one.

.

mrburnette: Years ago, I used a free program called StampPlot Pro, a quick Google shows it is still available for Windows: http://www.selmaware.com/stampplot/

Were I going to do this sort of thing today, I would likely just use Processing to perform the PC effort. This is an overview: https://www.arduino.cc/en/Tutorial/Graph

Of course, one could just connect a nice, inexpensive LCD to the Ardino and plot in that manner ... logging could be to SD if one really wanted recorded history. http://www.hackster.io/rayburne/color-barometric-extension-to-gps-date-time-clock

Or, one can use Excel as mentioned previously and with a little VBA help, you define your input range, graph, and the USB keyboard simulated data will always stay in a specified range. The basics are here: http://www.hackster.io/rayburne/arduino-to-excel-using-v-usb The above works particularly well with the 32U4 Micro running in keyboard emulation.

Ray

that program is no more free :( , LCD doesn't come in options i need full speed of arduino to measure RPM, and second thing display are to small, a need image on 15" screen at least.

.

That is exactly what I need http://www.megunolink.com/documentation/plotting/xy-plot/

but 15\$ is expensive for me :(

Think of it as an investment.

If you charge 3 people \$5 to use whatever it is you're building, it will have paid for itself. \$15 for 'exactly what you need' sounds pretty cheap.

BlackT:
Is it posible to plot graph on PC with x/y cordinate? Everything i found on internet plot y axis and x axis is always time. I need to determined both x and y cordinate than plot it

Do you need a real-time plot?

Do you have any experience with the python language?

BlackT:
that program is no more free…
<…>

arduino will send (x,y) cordinate every 0.1 sec

full speed of arduino to measure RPM,

100mS is a very long time even at the old 8-bit Arduino 16MHz clock. Newer 32-bit arduinos are much faster. STM32 clones (about \$4 USD) are 72MHz and fhe \$3 ESP8266 can run upto 160MHz.

Ray

I suggest to use Jupyter (python kernel). This is a demo I recorded few weeks ago: youtube video If you are interested, I can give you a short python code to plot your data in real-time.

INTP: Think of it as an investment.

If you charge 3 people \$5 to use whatever it is you're building, it will have paid for itself. \$15 for 'exactly what you need' sounds pretty cheap.

for 15\$ I wil get over that that I will get plot after I make full log. For this that i building real-time graph is only a "luxury". I build it for myself there is no charge to anyone, and I am student so every cent is valuable

RoMZERO: Do you need a real-time plot?

Do you have any experience with the python language?

Yes I need real-time plot and i don't have experience with python, but I learn fast and have will to learn somethnig new.

mrburnette: A "shareware" version is still available as a free download: http://stampplot-lite.software.informer.com

full speed of arduino to measure RPM,

100mS is a very long time even at the old 8-bit Arduino 16MHz clock. Newer 32-bit arduinos are much faster. STM32 clones (about \$4 USD) are 72MHz and fhe \$3 ESP8266 can run upto 160MHz.

Ray

Thank you very much, now I must make sketch and try this program...

RoMZERO: I suggest to use Jupyter (python kernel). This is a demo I recorded few weeks ago: youtube video If you are interested, I can give you a short python code to plot your data in real-time.

That would be very kind from you

Ok, first of all, you need to install Python and its Jupyter Notebook.
I suggest to download the Anaconda distribution ( https://www.continuum.io/downloads ), which is “easy” to handle for new users. Moreover, Anaconda already embeds some fundamental libraries you will need for your Arduino project (jupyter, matplotlib, etc.).
When you have installed Anaconda, the Jupyter icon will be at your disposal. So, just double-click on it or run “jupyter notebook” in your console/terminal and then wait the opening of the Jupyter Notebook in the default web browser.
Now you are ready to develop your own codes (i.e. Arduino sketch and python script).
Regarding the Arduino sketch, it is a simple piece of code. It sets the Arduino always ready to listen and answer to your commands through the serial port. Off course, Arduino will respond only to commands defined into the sketch and thus unknown inputs will be ignored.

Here an example of sketch:

``````void setup() {
Serial.begin(9600);
}

void loop() {
if (Serial.available()){
if (c == 'X'){
}
if (c == 'Y'){
}
}
}
``````

The Python code is a little bit more complicated, but it relatively easy to understand and thus to modify, if you have time to spend on it. I cut the script in several parts for your convenience. However, if you need help, just ask.

1. Importing libraries
``````import time
import serial
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from IPython import display
``````
1. Variable settings
``````x = y = []
counter = 1
cycle = 10
step = 1 # seconds
``````
1. Plotting data
``````%matplotlib inline
arduino = serial.Serial('COM3',9600) # set your COM port here
time.sleep(1)

plt.ion()
plt.show()
while counter <= cycle:
time.sleep(step)
plt.figure(figsize=(20, 10), dpi= 20, facecolor='w', edgecolor='k')
arduino.write('X'.encode())
x = np.append(x, espeed)
arduino.write('Y'.encode())