-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
mpl 2.0.0 vs 2.0.1 line style with wx-backend #8637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think this has anything to do with the wx backend. One of the style
changes for v2.0.0 had to do with scaling the line style patterns, however,
there was a bug in how it was implemented and that was fixed for v2.0.1,
IIRC.
As a side note, I notice that this new linestyle scaling feature isn't
mentioned in the "what's new" docs.
…On Wed, May 17, 2017 at 3:38 PM, edge-python ***@***.***> wrote:
I have taken the base code from:
https://matplotlib.org/examples/user_interfaces/embedding_in_wx4.html
user_interfaces example code: embedding_in_wx4.py
I have added:
import matplotlib.widgets # .Cursor
and in class CanvasFrame:
self.lineprops = dict(linewidth=0.5, linestyle='-.', color='grey', alpha=1)
self.line_cursor = matplotlib.widgets.Cursor(self.axes, **self.lineprops)
RESULT:
the line style in 2.0.1 (and 2.0.2) is very different to 2.0.0
I want the style of 2.0.0
What is the reason?
Thank you
[image: 2 0 0 vs 2 0 1]
<https://cloud.githubusercontent.com/assets/4279914/26172443/c793c162-3b48-11e7-9740-ba0cb494475c.gif>
- Operating System: Win 10 64bit
- Matplotlib Version: 2.0.0 vs 2.0.1 (and 2.0.2)
- Python Version: 3.6.1
- Other Libraries: wx 4.0.0a1
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8637>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-JPUdbqI1WV_5k5ycfy_jSHA7Oyzks5r60y7gaJpZM4NeWAA>
.
|
It's in API changes; this is not a bug, but a correction of less-desired behaviour. The line width is now actually consistent with the width you requested. |
Thank you for your answer. |
Actually, you might be able to get what you want... maybe. There is an
rcParam, 'lines.scale_dashes'. Try setting that to False. The (corrected)
old behavior was to clip the scaling of the dashes at around 0.5, IIRC, so
you *might* be able to get the old behavior (or something close to it,
perhaps?).
…On Thu, May 18, 2017 at 11:34 AM, edge-python ***@***.***> wrote:
Thank you for your answer.
but,
these are not good news for me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-GC0HMicQ4PgCrhKDxjFRXl6tRD8ks5r7GUAgaJpZM4NeWAA>
.
|
oh, you are so fast Please allow me a statement: |
The API change is due to #8032 (the relevant commit is 276e1e9). Basically the former scaling scheme was In your case, what about something like import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Cursor
# Manually rescale the desired dash pattern
# NB: plt.rcParams['lines.dashdot_pattern'] = [6.4, 1.6, 1.0, 1.6] but
# one could simply define our own on-off ink sequence (in points)
my_dashdot = [2.0*val for val in plt.rcParams['lines.dashdot_pattern']]
cursor_props = dict(linewidth=0.5, dashes=my_dashdot, color='#660099')
plt.close('all')
fig, ax = plt.subplots()
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2*np.pi*t)
ax.plot(t, s)
line_cursor = Cursor(ax, **cursor_props)
plt.show() Edit: English… |
Thank you for the example. many thanks for the support |
I am pretty sure BTW, using the dash-dot pattern from rcParams was just a mean of showing that you could manually scale one of the default patterns. But you could also perfectly use your own dash sequence if you are not satisfied with it. See the Line2D docstring for a comprehensive description of the API, or simply this example to get a quick glance at the syntax. In a nutshell, a dash style is an even-length sequence of on/off ink (in points). PS: a similar way to customize the dashes may be to define a custom line style, which can be seen as a custom dash style prepended with an “offset” (usually set to zero...), following the pattern |
That's a nice looking application :). |
I have taken the base code from:
https://matplotlib.org/examples/user_interfaces/embedding_in_wx4.html
user_interfaces example code: embedding_in_wx4.py
I have added:
import matplotlib.widgets # .Cursor
and in class CanvasFrame:
RESULT:
the line style in 2.0.1 (and 2.0.2) is very different to 2.0.0
I want the style of 2.0.0
What is the reason?
Thank you
The text was updated successfully, but these errors were encountered: