[Date Index]
[Thread Index]
[Author Index]
Re: How to get the options for ListPlot in V6
*To*: mathgroup at smc.vnet.net
*Subject*: [mg82960] Re: How to get the options for ListPlot in V6
*From*: "David Park" <djmpark at comcast.net>
*Date*: Mon, 5 Nov 2007 04:58:28 -0500 (EST)
*References*: <fghbjr$iu1$1@smc.vnet.net>
This is just another case where Mathematica graphics is messing around with
what is displayed in a plot but not leaving a public record of it. It is
very poor practice on the part of WRI. There were certainly many brilliant
advances in Version 6 graphics but precise control of ticks and the internal
bypassing of options is not one of them.
Here is your case again. Clearly, PlotRange and AxesOrigin do not reflect
the displayed plot.
test1list = Sin[2 \[Pi] Range[0, 1, .1]] + 10;
plot1 =
ListPlot[test1list]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
However, if we put almost anything in the plot that requires absolute
coordinates then the options will reflect the displayed plot. For example,
we can use Filling.
plot1 = ListPlot[test1list, Filling -> 10]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
Or we could use Tooltips.
plot1 = ListPlot[Tooltip@test1list]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
Probably the best solution is to use DataRange.
plot1 = ListPlot[test1list, DataRange -> Automatic]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
Another solution is to give an explicit PlotRange.
plot1 = ListPlot[test1list, PlotRange -> {{0, 11}, {9, 11}}]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
However, if we specify only the vertical PlotRange then the horizontal
PlotRange is still incorrect.
plot1 = ListPlot[test1list, PlotRange -> {9, 11}]
AbsoluteOptions[plot1, {PlotRange, AxesOrigin}]
Nor does specifying the AxesOrigin correct the PlotRange.
plot1=ListPlot[test1list,AxesOrigin->{0,10}]
AbsoluteOptions[plot1,{PlotRange,AxesOrigin}]
I don't think there is a reasonable explanation for this behavior from the
standpoint of a user interface. It is just poor code and poor design.
--
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/
"Aranthon" <a.dwarf at gmail.com> wrote in message
news:fghbjr$iu1$1 at smc.vnet.net...
> Hello all,
>
> I apologize if this has been discussed here already, but I couldn't
> find anything in the archives,
>
> I'm trying to write a function that manipulates the results of a
> ListPlot automatically, and to do so, I need to know the option values
> for PlotRange and AxesOrigin. Unfortunately, the results from
> AbsoluteOptions aren't making a lot of sense - the value for PlotRange
> is set to {{0,1},{0,1}}, and AxesOrigin is {0,0}, regardless of the
> actual values.
>
> For example:
>
> test = ListPlot[Sin[2 \[Pi] Range[0, 1, 0.1]] + 10]
>
> produces a plot where x ranges from 0 to 2 pi and y varies from 9 to
> 11. But
>
> AbsoluteOptions[test, PlotRange]
>
> returns {PlotRange -> {{0., 1.}, {0., 1.}}}
>
> If I load the Version5`Graphics` package, it works fine, so I'm
> wondering what changed in V6, and what Options I should be looking at
> to get the right answers.
>
> Thanks in advance for any replies,
>
> Greg
>
>
Prev by Date:
**How to Print without linebreaks?**
Next by Date:
**Re: Jagged Spine (MultinormalDistribution)**
Previous by thread:
**How to get the options for ListPlot in V6**
Next by thread:
**Re: Re: How to get the options for ListPlot in V6**
| |