tuple-marker in style sheet

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

tuple-marker in style sheet

Julian Gethmann
Hallo,

is it possible, and if so how, to define a marker with the tuple
definition (numsides, style, angle) [1] inside a style sheet (or
matplotlibrc)?

For normal markers I use the axes.prop_cycle like
```
axes.prop_cycle: cycler("marker", ["x", "+", "1"])
```
. If I now want to insert a tuple like marker,
```
axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)])
```
  then it is being transformed into a string `"(5, 2, 1)"`.
If I don't use parenthesis like in other tuple values in the
matplotlibrc (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is
interpreted as three different marker styles which do not exist [3].

[1] http://matplotlib.org/api/markers_api.html
[2] http://matplotlib.org/_static/matplotlibrc
[3] in my example: `ValueError: Unrecognized marker style 5`


Many thanks,

Julian
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: tuple-marker in style sheet

Benjamin Root
This *might* be fixed in master. Which version of matplotlib are you using?

On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann <[hidden email]> wrote:
Hallo,

is it possible, and if so how, to define a marker with the tuple definition (numsides, style, angle) [1] inside a style sheet (or matplotlibrc)?

For normal markers I use the axes.prop_cycle like
```
axes.prop_cycle: cycler("marker", ["x", "+", "1"])
```
. If I now want to insert a tuple like marker,
```
axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)])
```
 then it is being transformed into a string `"(5, 2, 1)"`.
If I don't use parenthesis like in other tuple values in the matplotlibrc (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as three different marker styles which do not exist [3].

[1] http://matplotlib.org/api/markers_api.html
[2] http://matplotlib.org/_static/matplotlibrc
[3] in my example: `ValueError: Unrecognized marker style 5`


Many thanks,

Julian
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: tuple-marker in style sheet

Julian Gethmann
On 08/09/2017 04:17 PM, Benjamin Root wrote:
> This *might* be fixed in master. Which version of matplotlib are you using?
Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build)

>
> On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann <
> [hidden email]> wrote:
>
>> Hallo,
>>
>> is it possible, and if so how, to define a marker with the tuple
>> definition (numsides, style, angle) [1] inside a style sheet (or
>> matplotlibrc)?
>>
>> For normal markers I use the axes.prop_cycle like
>> ```
>> axes.prop_cycle: cycler("marker", ["x", "+", "1"])
>> ```
>> . If I now want to insert a tuple like marker,
>> ```
>> axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)])
>> ```
>>   then it is being transformed into a string `"(5, 2, 1)"`.
>> If I don't use parenthesis like in other tuple values in the matplotlibrc
>> (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as
>> three different marker styles which do not exist [3].
>>
>> [1] http://matplotlib.org/api/markers_api.html
>> [2] http://matplotlib.org/_static/matplotlibrc
>> [3] in my example: `ValueError: Unrecognized marker style 5`
>>
>>
>> Many thanks,
>>
>> Julian
>> _______________________________________________
>> Matplotlib-users mailing list
>> [hidden email]
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: tuple-marker in style sheet

Julian Gethmann
On 08/09/2017 04:53 PM, Julian Gethmann wrote:
> On 08/09/2017 04:17 PM, Benjamin Root wrote:
>> This *might* be fixed in master. Which version of matplotlib are you
>> using?
> Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build)
Now I also tested the current master branch from github, but I also get
the same error message if I use parenthesis.
Do you know of which issue you were thinking of?

>>
>> On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann <
>> [hidden email]> wrote:
>>
>>> Hallo,
>>>
>>> is it possible, and if so how, to define a marker with the tuple
>>> definition (numsides, style, angle) [1] inside a style sheet (or
>>> matplotlibrc)?
>>>
>>> For normal markers I use the axes.prop_cycle like
>>> ```
>>> axes.prop_cycle: cycler("marker", ["x", "+", "1"])
>>> ```
>>> . If I now want to insert a tuple like marker,
>>> ```
>>> axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)])
>>> ```
>>>   then it is being transformed into a string `"(5, 2, 1)"`.
>>> If I don't use parenthesis like in other tuple values in the
>>> matplotlibrc
>>> (e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as
>>> three different marker styles which do not exist [3].
>>>
>>> [1] http://matplotlib.org/api/markers_api.html
>>> [2] http://matplotlib.org/_static/matplotlibrc
>>> [3] in my example: `ValueError: Unrecognized marker style 5`
>>>
>>>
>>> Many thanks,
>>>
>>> Julian
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> [hidden email]
>>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>>
>>
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: tuple-marker in style sheet

Benjamin Root
Hmmm, might be an issue with respect to specifying custom dash styles. It had a similar problem to this.

On Wed, Aug 9, 2017 at 11:35 AM, Julian <[hidden email]> wrote:
On 08/09/2017 04:53 PM, Julian Gethmann wrote:
On 08/09/2017 04:17 PM, Benjamin Root wrote:
This *might* be fixed in master. Which version of matplotlib are you using?
Ah, ok. I tested it with matplotlib 2.0.2 (anaconda Python 3.6.2 build)
Now I also tested the current master branch from github, but I also get the same error message if I use parenthesis.
Do you know of which issue you were thinking of?


On Wed, Aug 9, 2017 at 7:54 AM, Julian Gethmann <
[hidden email]> wrote:

Hallo,

is it possible, and if so how, to define a marker with the tuple
definition (numsides, style, angle) [1] inside a style sheet (or
matplotlibrc)?

For normal markers I use the axes.prop_cycle like
```
axes.prop_cycle: cycler("marker", ["x", "+", "1"])
```
. If I now want to insert a tuple like marker,
```
axes.prop_cycle: cycler("marker", ["x", "+", (5, 2, 1)])
```
  then it is being transformed into a string `"(5, 2, 1)"`.
If I don't use parenthesis like in other tuple values in the matplotlibrc
(e. g. `#lines.dashed_pattern : 2.8, 1.`[2]) then it is interpreted as
three different marker styles which do not exist [3].

[1] http://matplotlib.org/api/markers_api.html
[2] http://matplotlib.org/_static/matplotlibrc
[3] in my example: `ValueError: Unrecognized marker style 5`


Many thanks,

Julian
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users