plotting function with a singularity (NaN)

Asked by Aron Wahlberg on 2010-07-05

How can I plot a function with an infinite high spike? Can I cut off the value axis somehow?

Here's the error message:
AssertionError: Empty range, please specify vmin and/or vmax

How can I do that?

(function.vector().array() tells me that I have a NaN in one position and floats in all others.)



Question information

English Edit question
DOLFIN Edit question
No assignee Edit question
Last query:
Last reply:
Aron Wahlberg (aron-simula) said : #1

Of course I could say that function.vector()[pos] = 100.0, and then plot as long as I only have one singularity, but that's not really what I want.

Harish Narayanan (hnarayanan) said : #2

I would first check the well-posedness of the problem you are attempting to solve (and the way you are going about solving it) before proceeding any further.

Aron Wahlberg (aron-simula) said : #3

The problem is supposed to have a singularity.

Garth Wells (garth-wells) said : #4

On 05/07/10 10:56, Aron Wahlberg wrote:
> Question #116670 on DOLFIN changed:
> Aron Wahlberg gave more information on the question:
> The problem is supposed to have a singularity.

It still shouldn't have NaN in the vector - it's not a number, so the
various tools can't do anything with it.


Aron Wahlberg (aron-simula) said : #5

Right, I just thought that the error message suggested that I could specify some kind of window cut off to plot the function anyway.

Can you help with this problem?

Provide an answer of your own, or ask Aron Wahlberg for more information if necessary.

To post a message you must log in.