Re: Re: plotmarkers in Listplot
- To: mathgroup at smc.vnet.net
- Subject: [mg81348] Re: [mg81259] Re: [mg81242] plotmarkers in Listplot
- From: Brett Champion <brettc at wolfram.com>
- Date: Thu, 20 Sep 2007 03:47:16 -0400 (EDT)
- References: <200709170736.DAA15582@smc.vnet.net> <200709180433.AAA28523@smc.vnet.net> <93AFEEFC-5E58-4869-B176-BC9FBC30839B@mac.com>
On Sep 18, 2007, at 7:03 PM , Syd Geraghty wrote:
> Brett,
>
> Scaled does nothing for me. Tried several scaling factors with your
> code below with no effect.
>
My initial response was misleading, in part because I misunderstood
in what way it wasn't working.
The key to having Scaling work here is that the Graphic used for the
PlotMarker have a PlotRange that is not dependent on the scaled
object. What happens is that the PlotRange for Graphics[Scale[..]]
by default is chosen to tightly fit the contents. So these all look
the same:
Graphics[Scale[Disk[{0, 0}, 1], #]] & /@ {0.25, 0.5, 1}
while these behave as expected:
Graphics[Scale[Disk[{0, 0}, 1], #], PlotRange -> 1] & /@ {0.25, 0.5, 1}
Note that PlotMarkers has its own idea of how big the marker should
be, and this can be controlled by using {{marker1, size1},{marker2,
size2}, ...}.
Brett Champion
Wolfram Research
> The only way I could get desired output is :-
>
>
> rasterimage = First@Rasterize[Graphics3D[Sphere[], Boxed -> False]];
>
> ListLinePlot[{{1, 2, 3}, {4, 5, 6}},
> PlotMarkers -> Graphics[rasterimage, ImageSize -> 50],
> PlotRange -> {{0, 4}, {-2, 8}}, Mesh -> All, Frame -> True,
> AxesOrigin -> {0, 0}, ImageSize -> {1000, 1000}]
>
> $Version -> "6.0 for Mac OS X x86 (32-bit) (June 19, 2007)"
> MacBookPro2,1, Intel Core 2 Duo
> 2.33 GH
>
> What system & version of Mathematica did you use?
>
> Syd Geraghty
>
>
>
> On Sep 17, 2007, at 9:33 PM, Brett Champion wrote:
>
>> On Sep 17, 2007, at 2:36 AM , sdw wrote:
>>
>>> testing the use of listplot to plot an image at a set of
>>> locations, I
>>> find that the plotmarkers option does not understand Scale.
>>> rasterimage
>>> is a Raster primitive, with the desire to place the image at a
>>> set of
>>> locations defined by listplot.
>>>
>>>
>>>
>>> yes, there are potentially other ways to do this, but this should
>>> work
>>> too!
>>>
>>>
>>>
>>>
>>>
>>> ListPlot[{{1, 2, 3}, {4, 5, 6}}, PlotMarkers ->
>>> Graphics[Scale[rasterimage, .2]]]
>>>
>>
>> This works for me:
>>
>>
>>
>> rasterimage = First@Rasterize[Graphics3D[Sphere[]]];
>>
>> ListPlot[{{1, 2, 3}, {4, 5, 6}},
>> PlotMarkers -> Graphics[Scale[rasterimage, .2]]]
>>
>>
>>
>> What does Head[rasterimage] return for your example?
>>
>>
>>
>> Brett Champion
>> Wolfram Research
>>
>
--Apple-Mail-7--694638570
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 12644
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; "><div><div>On Sep 18, 2007, at =
7:03 PM , Syd Geraghty wrote:</div><br =
class="Apple-interchange-newline"><blockquote type="cite"> <div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Brett,</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Scaled does =
nothing for me. Tried several scaling factors with your code below with =
no effect.</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div></blockquote><div><br =
class="webkit-block-placeholder"></div><div>My initial response was =
misleading, in part because I misunderstood in what way it wasn't =
working.</div><div><br class="webkit-block-placeholder"></div><div>The =
key to having Scaling work here is that the Graphic used for the =
PlotMarker have a PlotRange that is not dependent on the scaled object. =
=A0What happens is that the PlotRange for Graphics[Scale[..]] by default =
is chosen to tightly fit the contents. =A0So these all look the =
same:</div><div><br class="webkit-block-placeholder"></div><div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Graphics[Scale[Disk[{0, 0}, 1], #]] & /@ {0.25, =
0.5, 1}</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">while these =
behave as expected:</div><div style="margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Graphics[Scale[Disk[{0, 0}, 1], #], PlotRange -> =
1] & /@ {0.25, 0.5, 1}</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Note that =
PlotMarkers has its own idea of how big the marker should be, and this =
can be controlled by using {{marker1, size1},{marker2, size2}, =
...}.</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Brett =
Champion</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Wolfram Research</div> =
</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div> =
</div><blockquote type="cite"><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The only way =
I could get desired output is :-</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br =
class="webkit-block-placeholder"></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">rasterimage ==
First@Rasterize[Graphics3D[Sphere[], Boxed -> False]];<br></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><br> ListLinePlot[{{1, 2, 3}, {4, 5, 6}}, <br> =
=A0PlotMarkers -> Graphics[rasterimage, ImageSize -> 50], <br> =
=A0PlotRange -> {{0, 4}, {-2, 8}}, Mesh -> All, Frame -> True, =
<br> =A0AxesOrigin -> {0, 0}, ImageSize -> {1000, 1000}]<br> =
</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: =
0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div><div=
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><font style="font: 12.0px =
Helvetica">$Version -> "6.0 for Mac OS X x86 (32-bit) (June 19, =
2007)"</font></div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 151px; text-indent: -151px; "><font =
style="font: 11.0px Lucida Grande"><font class="Apple-style-span" =
face="Helvetica" size="3"><span class="Apple-style-span" =
style="font-size: 12px;">MacBookPro2,1, Intel Core 2 =
Duo</span></font></font></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 151px; text-indent: =
-151px; "><font style="font: 11.0px Lucida Grande"><font =
class="Apple-style-span" face="Helvetica" size="3"><span =
class="Apple-style-span" style="font-size: 12px;">2.33 =
GH</span></font></font></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 151px; text-indent: =
-151px; "><font class="Apple-style-span" face="'Lucida Grande'" =
size="3"><span class="Apple-style-span" style="font-size: =
11px;"><br class="webkit-block-placeholder"></span></font></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 151px; text-indent: -151px; ">What system & version of =
Mathematica did you use?</div></div><br><div> <span =
class="Apple-style-span" style="border-collapse: separate; color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: 2; text-align: auto; text-indent: =
0px; text-transform: none; white-space: normal; widows: 2; word-spacing: =
0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" =
style="border-collapse: separate; border-spacing: 0px 0px; color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><div>Syd =
Geraghty</div><div><br class="khtml-block-placeholder"></div><br =
class="Apple-interchange-newline"></span></span> =
</div><br><div><div>On Sep 17, 2007, at 9:33 PM, Brett Champion =
wrote:</div><br class="Apple-interchange-newline"><blockquote =
type="cite"><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">On Sep 17, 2007, at 2:36 AM , =
sdw wrote:</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div> =
<blockquote type="cite"><div style="margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">testing the use of listplot =
to plot an image at a set of locations,<span =
class="Apple-converted-space">=A0 </span>I</div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">find that the plotmarkers option does not understand =
Scale.<span class="Apple-converted-space">=A0 =A0</span></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">rasterimage</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">is a Raster =
primitive,<span class="Apple-converted-space">=A0 </span>with the =
desire to place the image at a set of</div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">locations defined by listplot.</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: =
14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span =
class="Apple-converted-space">=A0</span>yes, there are potentially =
other ways to do this, but this should <span =
class="Apple-converted-space">=A0</span></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">work</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">too!</div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: =
14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">ListPlot[{{1, 2, 3}, {4, 5, 6}}, PlotMarkers -></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Graphics[Scale[rasterimage, .2]]]</div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div> </blockquote><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This =
works for me:</div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">rasterimage ==
First@Rasterize[Graphics3D[Sphere[]]];</div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ListPlot[{{1, =
2, 3}, {4, 5, 6}},</div><div style="margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><span =
class="Apple-converted-space">=A0 </span>PlotMarkers -> =
Graphics[Scale[rasterimage, .2]]]</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: =
14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">What =
does Head[rasterimage] return for your example?</div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
min-height: 14px; "><br></div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: =
14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">Brett Champion</div><div =
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Wolfram Research</div><div style="margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: =
14px; "><br></div> =
</blockquote></div><br></blockquote></div><br></body></html>=
--Apple-Mail-7--694638570--
- References:
- plotmarkers in Listplot
- From: "sdw" <warwick@jps.net>
- Re: plotmarkers in Listplot
- From: Brett Champion <brettc@wolfram.com>
- plotmarkers in Listplot