# plotting positions with non-default markers

To visualize a simulation, I would like to plot positions of two populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and rotated \$\perp\$) symbols as markers, but make the coordinates coincide with the line intersections in the symbols. In this way, if two points from different populations have the same coordinates they should create a cross with a long vertical line.

I have tried using plt.text and \$\perp\$, with a 90 degree rotation to get \$\bot\$:

text(x,y,r?\$\bot\$', va=?top',ha='center',color='w',rotation=180,fontsize=14)

but this doesn?t really work or scale, and I would rather use plot or scatter instead of text.

Is there a good way to do this in pyplot? Should I use something else?

Thank you

Jo?o

I wonder if Ryan May's "scattertext()" work might be what you are looking
for? https://github.com/matplotlib/matplotlib/pull/4063

Cheers!
Ben Root

···

On Tue, Dec 1, 2015 at 12:54 PM, Joao Fonseca <joao.q.fonseca at gmail.com> wrote:

To visualize a simulation, I would like to plot positions of two
populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and rotated
\$\perp\$) symbols as markers, but make the coordinates coincide with the
line intersections in the symbols. In this way, if two points from
different populations have the same coordinates they should create a cross
with a long vertical line.

I have tried using plt.text and \$\perp\$, with a 90 degree rotation to get
\$\bot\$:

text(x,y,r?\$\bot\$',
va=?top',ha='center',color='w',rotation=180,fontsize=14)

but this doesn?t really work or scale, and I would rather use plot or

Is there a good way to do this in pyplot? Should I use something else?

Thank you

Jo?o
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151201/063d69b2/attachment.html>

To visualize a simulation, I would like to plot positions of two
populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and
rotated \$\perp\$) symbols as markers, but make the coordinates
coincide with the line intersections in the symbols. In this way, if
two points from different populations have the same coordinates they
should create a cross with a long vertical line.

I have tried using plt.text and \$\perp\$, with a 90 degree rotation
to get \$\bot\$:

text(x,y,r?\$\bot\$',
va=?top',ha='center',color='w',rotation=180,fontsize=14)

but this doesn?t really work or scale, and I would rather use plot or

Is there a good way to do this in pyplot? Should I use something
else?

import matplotlib.pyplot as plt

# Make your own marker by giving vertices like this:
mbot = ((-7, 0), (0, 0), (0, 20), (0, 0), (7, 0))

fig, ax = plt.subplots()
ax.plot([1, 2, 3], marker=mbot, ms=20, mew=1,
mfc='none', linestyle='none')
ax.margins(0.1)
plt.show()

Eric

···

On 2015/12/01 7:54 AM, Joao Fonseca wrote:

Thank you

Jo?o
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

This is just what I was after, thanks! And scattertext() looks pretty handy as well.

Jo?o

···

On 1 Dec 2015, at 19:04, Eric Firing <efiring at hawaii.edu> wrote:

On 2015/12/01 7:54 AM, Joao Fonseca wrote:

To visualize a simulation, I would like to plot positions of two
populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and
rotated \$\perp\$) symbols as markers, but make the coordinates
coincide with the line intersections in the symbols. In this way, if
two points from different populations have the same coordinates they
should create a cross with a long vertical line.

I have tried using plt.text and \$\perp\$, with a 90 degree rotation
to get \$\bot\$:

text(x,y,r?\$\bot\$',
va=?top',ha='center',color='w',rotation=180,fontsize=14)

but this doesn?t really work or scale, and I would rather use plot or

Is there a good way to do this in pyplot? Should I use something
else?

import matplotlib.pyplot as plt

# Make your own marker by giving vertices like this:
mbot = ((-7, 0), (0, 0), (0, 20), (0, 0), (7, 0))

fig, ax = plt.subplots()
ax.plot([1, 2, 3], marker=mbot, ms=20, mew=1,
mfc='none', linestyle='none')
ax.margins(0.1)
plt.show()

Eric

Thank you

Jo?o
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

Just for completeness, I should mention you can also pass any math string
as a marker as well:

plt.plot([1,2,3], marker=r'\$\bot\$')

Mike
?

···

On Tue, Dec 1, 2015 at 3:44 PM, Joao Fonseca <joao.q.fonseca at gmail.com> wrote:

This is just what I was after, thanks! And scattertext() looks pretty
handy as well.

Jo?o

> On 1 Dec 2015, at 19:04, Eric Firing <efiring at hawaii.edu> wrote:
>
> On 2015/12/01 7:54 AM, Joao Fonseca wrote:
>> To visualize a simulation, I would like to plot positions of two
>> populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and
>> rotated \$\perp\$) symbols as markers, but make the coordinates
>> coincide with the line intersections in the symbols. In this way, if
>> two points from different populations have the same coordinates they
>> should create a cross with a long vertical line.
>>
>> I have tried using plt.text and \$\perp\$, with a 90 degree rotation
>> to get \$\bot\$:
>>
>> text(x,y,r?\$\bot\$',
>> va=?top',ha='center',color='w',rotation=180,fontsize=14)
>>
>> but this doesn?t really work or scale, and I would rather use plot or
>>
>> Is there a good way to do this in pyplot? Should I use something
>> else?
>
>
> import matplotlib.pyplot as plt
>
> # Make your own marker by giving vertices like this:
> mbot = ((-7, 0), (0, 0), (0, 20), (0, 0), (7, 0))
>
> fig, ax = plt.subplots()
> ax.plot([1, 2, 3], marker=mbot, ms=20, mew=1,
> mfc='none', linestyle='none')
> ax.margins(0.1)
> plt.show()
>
>
> Eric
>
>
>
>>
>> Thank you
>>
>> Jo?o
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

--
Michael Droettboom
Continuum Analytics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151202/8d66349e/attachment.html>

Just for completeness, I should mention you can also pass any math
string as a marker as well:

>plt.plot([1,2,3], marker=r'\$\bot\$') |

To complete the completeness, how will it be located? What part of the
rendered string lands at the specified data location?

Eric

···

On 2015/12/02 4:09 AM, Michael Droettboom wrote:

Mike

?

On Tue, Dec 1, 2015 at 3:44 PM, Joao Fonseca <joao.q.fonseca at gmail.com > <mailto:joao.q.fonseca at gmail.com>> wrote:

This is just what I was after, thanks! And scattertext() looks
pretty handy as well.

Jo?o

> On 1 Dec 2015, at 19:04, Eric Firing <efiring at hawaii.edu > <mailto:efiring at hawaii.edu>> wrote:
>
> On 2015/12/01 7:54 AM, Joao Fonseca wrote:
>> To visualize a simulation, I would like to plot positions of two
>> populations using the \$\top\$ and \$\bot\$ (similar to \$\perp\$ and
>> rotated \$\perp\$) symbols as markers, but make the coordinates
>> coincide with the line intersections in the symbols. In this way, if
>> two points from different populations have the same coordinates they
>> should create a cross with a long vertical line.
>>
>> I have tried using plt.text and \$\perp\$, with a 90 degree rotation
>> to get \$\bot\$:
>>
>> text(x,y,r?\$\bot\$',
>> va=?top',ha='center',color='w',rotation=180,fontsize=14)
>>
>> but this doesn?t really work or scale, and I would rather use
plot or
>>
>> Is there a good way to do this in pyplot? Should I use something
>> else?
>
>
> import matplotlib.pyplot as plt
>
> # Make your own marker by giving vertices like this:
> mbot = ((-7, 0), (0, 0), (0, 20), (0, 0), (7, 0))
>
> fig, ax = plt.subplots()
> ax.plot([1, 2, 3], marker=mbot, ms=20, mew=1,
> mfc='none', linestyle='none')
> ax.margins(0.1)
> plt.show()
>
>
> Eric
>
>
>
>>
>> Thank you
>>
>> Jo?o
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
> https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
https://mail.python.org/mailman/listinfo/matplotlib-users

--
Michael Droettboom
Continuum Analytics

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users