-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] Matplotlib output for Scatter plot #3134
Conversation
This is a good first step, but it needs some polishing. In the case when dots where colored I am missing a legend. Also, the code includes two calls to In any case, the output is much better than current PDF output. It would be great to work on this prototype and complete it to PR, and then ask Jure to help in polishing it. In summary:
|
Also, could you please add "Portable Document Format (from Matplotlib) (*.pdf)" to the list of supported outputs. The order of the outputs would then be:
|
a29cdf4
to
d05db8e
Compare
Codecov Report
@@ Coverage Diff @@
## master #3134 +/- ##
==========================================
+ Coverage 82.74% 82.81% +0.06%
==========================================
Files 344 346 +2
Lines 59323 59545 +222
==========================================
+ Hits 49088 49313 +225
+ Misses 10235 10232 -3 |
d05db8e
to
73571fe
Compare
Works well! When exporting matplotlib pdf's on Mac, OS X asks to modify the extension and the whole process gets confusing. Could you please remove .matplotlib from the extension and simply use pdf? Also, if possible, when saving to .py, reduce the precision edgecolors and facecolors to reduce the size of the file. When these are saved for categorical values, perhaps the length of this file could be reduced even more if edgecolors and facecolors would be created programmatically, avoiding creating arrays with huge chunks of arrays with same numbers. |
5c3b86f
to
d5d1665
Compare
I added "compression" of colors to shorten the generated code. Generating code with different numpy versions is a pain - therefore I avoided numpy's repr. This exporter is now only enabled for the scatterplot as the only ".pdf" exporter. Missing functionality:
A test for the CD diagram fail now. It only fails if I run all the tests, not just that one. Perhaps some file imports matplotlib before and that confuses it. @lanzagar ? If we are making matplotlib a dependency, that is easy to solve: just stop using mock in that test. Warning: I added matplotlib to requirements. Before merging we would need to take care that package build files are updated. Looking back, I think this PR should be reimplemented. Reading from pyqtgraph structures has many hidden details, and the code generator is then not aware of what the content really means. implementing equivalent functionality in the corresponding widgets (which also know the meaning of what they draw) should be better. I did not go that way because:
A mistake, probably! |
On "I think this PR should be reimplemented: reading from pyqtgraph structures has many hidden details, and the code generator is then not aware of what the content really means." -- I agree, it would probably be easier if the implementation would be widget-specific, but at this stage, what do you suggest. I guess we have two options:
@markotoplak, which one do you think is better? I wish this implementation would set an example how to implement this functionality in other widgets, where reading the pyqtgraph structures would be even more problematic or not possible since other means of plotting where used. Example include hierarchical clustering, box plot, and silhouette plot. |
If you need it now, merge. Before that, someone need to take care of
matplolib dependecy and a the CD test (I can only do it after 12.8.), which
now, that matplotlib is actually imported, behaves strengely. Then we will
at least have some idea how people use it.
…On Tue, Jul 31, 2018, 12:36 Blaž ***@***.***> wrote:
@markotoplak <https://github.com/markotoplak>, on "I think this PR should
be reimplemented. Reading from pyqtgraph structures has many hidden
details, and the code generator is then not aware of what the content
really means." -- I agree, it would probably be easier if the
implementation would be widget-specific, but at this stage, what do you
suggest. I guess we have three options:
1. merge these changes reimplement
2. close with no merge, reimplement
I wish this implementation would set an example how to implement this
functionality in other widgets, where reading the pyqtgraph structures
would be even more problematic or not possible since other means of
plotting where used. Example include hierarchical clustering, box plot, and
silhouette plot.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3134 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAhs9hL6jQpdKyy_QacZO-OXnODMftapks5uMDM2gaJpZM4VPAwC>
.
|
This fixes the selection output.
1786167
to
f4a8a4f
Compare
@ales-erjavec, could you please check if I added the matplotlib dependency correctly? |
Looks Ok. |
Issue
Our outputs are ugly and non-configurable. Outputting python code could solve output flexibility problem for people with basic programming knowledge.
Description of changes
The changes here just enable the user to save graphs as Python code. Currently a pyplot plot is drawn directly.
The code gets the data for drawing from the pyqtgraph's graph.
Includes