Re: Plotting a large dataset
- To: mathgroup at smc.vnet.net
- Subject: [mg94315] Re: Plotting a large dataset
- From: Nikolaus Rath <Nikolaus at rath.org>
- Date: Wed, 10 Dec 2008 04:47:32 -0500 (EST)
- References: <ghj057$fid$1@smc.vnet.net> <ghlmfk$k9e$1@smc.vnet.net>
Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com> writes:
> Nikolaus Rath wrote:
>
>> I have trouble plotting a dataset of 2048000 reals. I tried the
>> following code (as recently suggested on the list):
>>
>> xdata1 = ReadList[prefix <> "1.dat", Real, RecordLists -> False];
>> xdata1 = Developer`ToPackedArray[xdata1];
>> Dimensions[xdata1]
>> (* yields {2048000} *)
>> ListPlot[xdata1, PerformanceGoal -> "Speed"]
>>
>>
>> but I'm simply running out of main memory (2 GB available). Since I
>> can plot the same data within seconds using IDL, I guess Mathematica
>> should be able to do the same. But how?
>
> Hi Nikolaus,
>
> Assuming I have understood correctly what the problem is, using the
> option *MaxPlotPoints*, fed with some appropriate value depending on
> your actual dataset, should allow ListPlot[] to display a meaningful
> plot exhibiting the main characteristics or trends of your data while
> being memory conservative.
This works *much* better, thank you! Were did you learn about this
option? The ListPlot help in Mathematica 6.0.2 doesn't mention it.
Btw, I also discovered that another alternative is to construct an
Interpolation from the dataset and then plot the interpolation with
Plot[].
-Nikolaus
--
=C2=BBIt is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that.=C2=AB
-J.H. Hardy
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C