473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Plotting a graph

Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph
disappears immediately (after the last plot). Writing " " to a label, in
between subsequent plots, solves this problem. Could someone please shed
some light on the cause of this?
Thank you,
Adrian.
Aug 24 '07 #1
8 2931
Um, you haven't told us *anything* about what kind of graphing software,
component, or class this is, or how it might be used . . .
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Adrian" wrote:
Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph
disappears immediately (after the last plot). Writing " " to a label, in
between subsequent plots, solves this problem. Could someone please shed
some light on the cause of this?
Thank you,
Adrian.
Aug 24 '07 #2

"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:EB**********************************@microsof t.com...
Um, you haven't told us *anything* about what kind of graphing software,
component, or class this is, or how it might be used . . .
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Adrian" wrote:
>Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph
disappears immediately (after the last plot). Writing " " to a label, in
between subsequent plots, solves this problem. Could someone please shed
some light on the cause of this?
Thank you,
Adrian.
The sort of information you have asked me for might not be applicable to the
issue at hand. I create a matrix (horizontal and vertical lines at constant
intervals) and draw a graph in that matrix running from interval to
interval, subsequent graph-lines per interval connecting to
previous-graph-lines per interval, thus summating the graph-line from one
side of the matrix to the other side of the matrix. What more can I say?

Adrian.
Aug 24 '07 #3
Adrian wrote:
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.comwrote
in message news:EB**********************************@microsof t.com...
>Um, you haven't told us *anything* about what kind of graphing software,
component, or class this is, or how it might be used . . .

The sort of information you have asked me for might not be applicable to the
issue at hand.
I think his more general point is that you haven't provided any sort of
description that allows _any_ understanding of the context or the
specific implementation.
I create a matrix (horizontal and vertical lines at constant
intervals) and draw a graph in that matrix running from interval to
interval, subsequent graph-lines per interval connecting to
previous-graph-lines per interval, thus summating the graph-line from one
side of the matrix to the other side of the matrix. What more can I say?
That is more information than we had before. Are you adding new lines
each interval as data comes in, or something like that?

The behavior you're describing is common when someone has implemented
drawing without understanding what actually happens with the drawing.
In particular, it's important to understand that in Windows (and many
other GUI OS's for that matter), it is up to the application to be able
to redraw the _entire_ image every time it is requested to.

A common beginner mistake is to just draw as desired into a window, and
expect the drawing to stay there. It won't. Anything that might cause
the window to need redrawing is likely to mess things up.

You can't just draw new data as it comes in. You have to keep _all_ of
the data somewhere that might be visible on the screen, and redraw _all_
of the data whenever you are asked to (this is done by overriding
OnPaint or handling the Paint event). One option you have is to draw
into an off-screen Bitmap as data comes in, and then use that Bitmap
when responding to the paint event. But you have to keep the data
somehow, whether it's graphically in an off-screen Bitmap, or stored as
the original data in some other data structure.

Pete
Aug 24 '07 #4
"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:13*************@corp.supernews.com...
Adrian wrote:
>"Peter Bromberg [C# MVP]" <pb*******@yahoo.yohohhoandabottleofrum.com>
wrote in message
news:EB**********************************@microso ft.com...
>>Um, you haven't told us *anything* about what kind of graphing software,
component, or class this is, or how it might be used . . .

The sort of information you have asked me for might not be applicable to
the issue at hand.

I think his more general point is that you haven't provided any sort of
description that allows _any_ understanding of the context or the specific
implementation.
>I create a matrix (horizontal and vertical lines at constant intervals)
and draw a graph in that matrix running from interval to interval,
subsequent graph-lines per interval connecting to previous-graph-lines
per interval, thus summating the graph-line from one side of the matrix
to the other side of the matrix. What more can I say?

That is more information than we had before. Are you adding new lines
each interval as data comes in, or something like that?

The behavior you're describing is common when someone has implemented
drawing without understanding what actually happens with the drawing. In
particular, it's important to understand that in Windows (and many other
GUI OS's for that matter), it is up to the application to be able to
redraw the _entire_ image every time it is requested to.

A common beginner mistake is to just draw as desired into a window, and
expect the drawing to stay there. It won't. Anything that might cause
the window to need redrawing is likely to mess things up.

You can't just draw new data as it comes in. You have to keep _all_ of
the data somewhere that might be visible on the screen, and redraw _all_
of the data whenever you are asked to (this is done by overriding OnPaint
or handling the Paint event). One option you have is to draw into an
off-screen Bitmap as data comes in, and then use that Bitmap when
responding to the paint event. But you have to keep the data somehow,
whether it's graphically in an off-screen Bitmap, or stored as the
original data in some other data structure.

Pete
Thank you for your very interesting outline of graph-drawing. Actually the
graph is showing very nicely after the measure I took. I was asking why what
I did solved the problem that I encountered. (That was the question I was
asking.) I would like to consider this discussion as closed now, we don't
seem to be arriving at a conclusion.

Regards,
Adrian.
Aug 24 '07 #5
Adrian wrote:
Thank you for your very interesting outline of graph-drawing.
Here's another suggestion, meant only to help you get information you need:

It is not useful to reply sarcastically to well-intentioned posts.
Also, if you find yourself thinking a sarcastic response is appropriate,
you may have missed the point of a well-intentioned post.
Actually the
graph is showing very nicely after the measure I took.
All that means is that there's some side-effect that has somehow
obscured the bug you have. If you intend to consider yourself seriously
as a programmer, this is NOT an appropriate to fix a bug.
I was asking why what
I did solved the problem that I encountered. (That was the question I was
asking.) I would like to consider this discussion as closed now, we don't
seem to be arriving at a conclusion.
That seems to be because you aren't interested in taking replies seriously.

I don't know why what you did fixed the problem. I also don't know why
you had the problem in the first place. You've done little to share
with us what the code is actually doing, so it's impossible to offer any
specific advice.

What I _can_ do is tell you what I know, based on what little you have
shared, and how that relates to commonly seen errors.

I have done that. I'm sorry you don't find it useful. But rest
assured, you haven't done anything so far that should lead you to feel
that the issue is "closed". You are almost certainly going to run into
the exact same problem you had before, simply by doing something
different (maybe a new window appears on top of your graph window, or
the user drags part of it off-screen or something like that).

If you don't fix the original bug, it hasn't gone away. Learn this
lesson now, or learn it later. But until you learn the lesson, you are
going to continue to have problems.

Pete
Aug 25 '07 #6

"Peter Duniho" wrote:
"... The behavior you're describing is common when someone has implemented
drawing without understanding what actually happens ..."

"... A common beginner mistake ... "

"... not useful to reply sarcastically ..."
"... If you intend to consider yourself seriously as a programmer ..."
"... you aren't interested in taking replies seriously ...."
Please don't do this, it is unprofessional.

Adrian.
Aug 25 '07 #7
Adrian wrote:
"Peter Duniho" wrote:
"... The behavior you're describing is common when someone has implemented
drawing without understanding what actually happens ..."

"... A common beginner mistake ... "

"... not useful to reply sarcastically ..."
"... If you intend to consider yourself seriously as a programmer ..."
"... you aren't interested in taking replies seriously ...."
Please don't do this, it is unprofessional.
You don't want me to write the truth? You think it's unprofessional to
do so? There is not a single statement that you quoted that in context
is in any way not a factual, truthful statement.

The fact is, you are refusing to take seriously advice that is serious
business. You refuse to post an actual concise-but-complete example of
code demonstrating your problem in spite of being told that's exactly
what you need to do for getting the best answers to your question, and
yet you object to replies that do their best to speculate on what your
problem actually is.

You insist that you know what you're doing, and yet your "solution"
involves adding a line of code that has no direct connection with the
problematic behavior, and for which you have no understanding of why it
changes the behavior.

In addition, there's nothing in your posts to suggest that you actually
understand the required mechanism for handling paint events in the
Windows architecture, and based on the symptoms you've described there
is at least some evidence that you do not. And yet, you bristle at the
suggestion that you might not, even as you continue to refuse to post
any code that might confirm or refute your understanding of the Windows
screen-updating paradigm.

This sort of behavior is the opposite of how a professional would
behave, so I hope you are not too surprised when I find it impossible to
take seriously a suggestion from you regarding what is and what is not
professional behavior.

I am happy to refrain from trying to help you, if that's really what you
want. The fact is, it's pretty frustrating to try to give advice to
someone who isn't willing to pull their own weight in the effort to
solve their problems, and who acts defensively and ungratefully when
well-intended advice is provided to them. That's frustration I can do
without.

So, good luck with everything.

Pete
Aug 25 '07 #8
"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:13*************@corp.supernews.com...
Adrian wrote:
>"Peter Duniho" wrote:
"... The behavior you're describing is common when someone has
implemented
drawing without understanding what actually happens ..."

"... A common beginner mistake ... "

"... not useful to reply sarcastically ..."
"... If you intend to consider yourself seriously as a programmer ..."
"... you aren't interested in taking replies seriously ...."
Please don't do this, it is unprofessional.

You don't want me to write the truth? You think it's unprofessional to do
so? There is not a single statement that you quoted that in context is in
any way not a factual, truthful statement.

The fact is, you are refusing to take seriously advice that is serious
business. You refuse to post an actual concise-but-complete example of
code demonstrating your problem in spite of being told that's exactly what
you need to do for getting the best answers to your question, and yet you
object to replies that do their best to speculate on what your problem
actually is.

You insist that you know what you're doing, and yet your "solution"
involves adding a line of code that has no direct connection with the
problematic behavior, and for which you have no understanding of why it
changes the behavior.

In addition, there's nothing in your posts to suggest that you actually
understand the required mechanism for handling paint events in the Windows
architecture, and based on the symptoms you've described there is at least
some evidence that you do not. And yet, you bristle at the suggestion
that you might not, even as you continue to refuse to post any code that
might confirm or refute your understanding of the Windows screen-updating
paradigm.

This sort of behavior is the opposite of how a professional would behave,
so I hope you are not too surprised when I find it impossible to take
seriously a suggestion from you regarding what is and what is not
professional behavior.

I am happy to refrain from trying to help you, if that's really what you
want. The fact is, it's pretty frustrating to try to give advice to
someone who isn't willing to pull their own weight in the effort to solve
their problems, and who acts defensively and ungratefully when
well-intended advice is provided to them. That's frustration I can do
without.

So, good luck with everything.

Pete
Pete,

You are misusing my query to wank your ego.

Adrian.
Aug 25 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: KevinGPO | last post by:
I am making a monitor program for the PC. My monitor program will grab statistics about CPU and memory every 1 or 5 seconds. Then I want to store this data so I have a history and hence be able to...
12
by: Russ | last post by:
I'm interested in setting up a web page where live data can be displayed in real-time on the web page. For example: I would like to display a (nice looking) graph of some data value versus time...
11
by: Chapman | last post by:
Is it possible to plot the graph as an output of my program in C? It can be a simple graph as quadratic curves for example or a correlation between 2 variables only. Thanks
1
by: wayne | last post by:
i want to plot a line graph. The values that I obtain are the RGB value of a TIFF image. i m plotting RGB values vs value(1,2,3..) so when generated the RGB values, there will b a column of values...
3
by: i | last post by:
Hi, I'm working with an array of nodes, numbering roughly in the thousands. Each node has at least one, but up to four, references to another node - North, South, East, or West. I'm trying to...
7
by: diffuser78 | last post by:
My python program spits lot of data. I take that data and plot graphs using OfficeOrg spredsheet. I want to automate this task as this takes so much of time. I have some questions. 1. Which is...
4
by: Gouri | last post by:
Hi, Got a query regarding plotting a preview / thumbnail for a graph which reads data from a binary file. The preview should should take very less time, look exactly like the original graph i.e....
5
by: Narendar123P | last post by:
Hi all, I am trying to plot a graph in excel file using C#.Net. I am using the name space excel . If my graph has one series(2 columns), i am able to draw the graph. if my graph has two series(4...
3
by: 9966 | last post by:
Greetings, I'm currently having problem in plotting a simple graph in C++. I learned that we can actually use koolplot to do it. My question is whether it is possible to plot, let's say the...
2
by: Durand | last post by:
Hi, I'm trying to plot a simple graph against date or time using matplotlib. I've read about date_plot but I'm not really sure how to use it. At the moment, I have some data arranged into lists,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.