Ticket #8912 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Python Command Line interface improvements

Reported by: Nick Draper Owned by: Federico M Pouzols
Priority: critical Milestone: Release 3.3
Component: Python Keywords: SSC,2014,All
Cc: Blocked By: #8937, #10015
Blocking: #10799 Tester: Raquel Alvarez Banos

Description

Look to the notes from the VATES/Horace discussions

"Improve plotting lexicon: More matplotlib like plot command.
Better overplotting with commands/using handles

See tiling displays"

Attachments

future_pyplot_examples.py (2.9 KB) - added by Federico M Pouzols 6 years ago.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Python API

comment:2 Changed 7 years ago by Owen Arnold

  • Blocked By 8937 added

comment:3 Changed 7 years ago by Owen Arnold

  • Owner set to Owen Arnold

comment:4 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move of tickets out of triage (new) to assigned at the introduction of the triage state

comment:5 Changed 6 years ago by Nick Draper

  • Milestone changed from Release 3.2 to Release 3.3

comment:6 Changed 6 years ago by Owen Arnold

  • Status changed from assigned to inprogress

refs #8912. Start work looking at pyplot.plot.

Changeset: d4b637d257a1cac3d48ffcfada46ea5534e3f816

comment:7 Changed 6 years ago by Owen Arnold

refs #8912. Remove mantidplot.py

Changeset: d391b93c3c5b5650fb7e72d5d0991b0ae0542153

comment:8 Changed 6 years ago by Owen Arnold

refs #8912. Array to workspaces

Changeset: 8c50c3e39654b3aa104c6350af4eaf8f67c78925

comment:9 Changed 6 years ago by Owen Arnold

refs #8912. Add doc strings

This is not yet complient with the matplotlib pyplot plot function. That will be the next step.

Changeset: a796b7ec08cd2565f2ad6c7da331f183b7594c5d

comment:10 Changed 6 years ago by Owen Arnold

refs #8912. Common create workspace code.

Changeset: 890e4e7120d31878fc6101fb8bb8d1b09f0957ac

comment:11 Changed 6 years ago by Owen Arnold

refs #8912. Down to args and kwargs.

Changeset: 2018871207f527c22033dee7be2b6f18b0db3774

comment:12 Changed 6 years ago by Owen Arnold

Some questions that have to be considered.

1) How do we support the old-style plot options. For example error_bars, etc.

I suggest moving these to kwargs.

2) What about spectrum numbers (indicies)?

I suggest that the indices are treated as positional arguments. For workspaces (unlike arrays) we do not need the x-array, so if a second argument is given after a workspace, then that should be taken to be the list of indices. I suggest mandating that indices are provided because they currently are for plotSpectrum. The third option can be used as the plot marker.

3) What about the repeated multi-line format (see http://matplotlib.org/api/pyplot_api.html)?

This should work with workspaces as well as arrays. I'm not sure about the plot marker control via qtiplot in general yet, but if that can be resolved quickly, then this should be feasible. i.e, plot(ws1, 0, 'ro', ws2, 0, 'g').

comment:13 Changed 6 years ago by Federico Montesino Pouzols

Expose (basic version of) QwtPlotCurve through SIP binding, re #8912

Changeset: 1340af89e58f243199b7a3669a19fa98de839ed6

comment:14 Changed 6 years ago by Federico Montesino Pouzols

clarify what type means in the doc of plotSpectrum, re #8912

Changeset: 68136fcf43a8b51d0c835c5abcdd0cede899fd58

comment:15 Changed 6 years ago by Federico Montesino Pouzols

Expose QwtData so we can get lines' x andy data, re #8912

Changeset: 40bfe49aa5cb8b3513456324d4db9d42079ef4b6

comment:16 Changed 6 years ago by Federico Montesino Pouzols

A bit of doc, and many methods into dir re #8912

Changeset: 7ac0f1f497cd374440fb7debe96be513ff8277c2

comment:17 Changed 6 years ago by Federico Montesino Pouzols

First decent version of new CLI, still some TODOs, re #8912

Changeset: 224fa6f171f1ce6d41354df52a88f2a5419800b3

comment:18 Changed 6 years ago by Federico Montesino Pouzols

comment:19 Changed 6 years ago by Federico Montesino Pouzols

Some more methods shown thru dir re #8912

Changeset: 4e5b69c2fd39def9201a98471d849b3ccfeb6499

comment:20 Changed 6 years ago by Federico Montesino Pouzols

comment about 'hold', re #8912

Changeset: 183e01ae6c2a3138885cc4d8642da5940c80bc0c

comment:21 Changed 6 years ago by Federico Montesino Pouzols

Check minimum inputs with tool=..., re #8912

Changeset: 5129279751142bcd4a698796f77698805df0b0a4

comment:22 Changed 6 years ago by Federico Montesino Pouzols

Note about the size_t issue, re #8912

Changeset: d31105c098c98ec407c59644d30820ff4f934120

comment:23 Changed 6 years ago by Federico Montesino Pouzols

New unit test for future.pyplot, re #8912

Changeset: a3974700c9b167893e5ec34fb777229dea816e81

comment:24 Changed 6 years ago by Federico Montesino Pouzols

Figure class, better doc, re #8912

Changeset: 5a482c186be702f9358a07e4d496b053a7493186

comment:25 Changed 6 years ago by Federico Montesino Pouzols

test multi-plot commands, and MD plots, re #8912

Changeset: c7da6b5ab176dc5ec3496aecb815567faecbe03e

comment:26 Changed 6 years ago by Federico Montesino Pouzols

doc improvements and handling of multi-plot commands, re #8912

Changeset: 17e8178d599d338748be3818db9ad6114d4d5939

comment:27 Changed 6 years ago by Federico Montesino Pouzols

also check the x/y data in the lines returned by plots, re #8912

Changeset: c586b7d786452e0570b09ccb816252dd1b8ac1ad

comment:28 Changed 6 years ago by Federico Montesino Pouzols

more tests for different args, kwargs, re #8912

Changeset: 5ad61f953bee3987e034709a69476b25854427bf

comment:29 Changed 6 years ago by Federico Montesino Pouzols

doc improvements, error_bars, hold, multi-plots back in, re #8912

Changeset: e273482156da89d8ff719747e1326f10f718f62c

comment:30 Changed 6 years ago by Federico Montesino Pouzols

proper MD test, and use assertEqual when possible, re #8912

Changeset: 77b304fc83440e3fa827c1f2a967c9237971fde8

comment:31 Changed 6 years ago by Federico Montesino Pouzols

better input checks, fixed multi-plot, re #8912

Changeset: 4a0ebcd6c0c9550568e3a4c36c574578fa0c01d0

comment:32 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI' into develop, re #8912

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

Changeset: c0a827f94a0d85c4044aee77d700c09bdf780273

comment:33 Changed 6 years ago by Federico Montesino Pouzols

fix conflict issues, re #8912

Changeset: c3d4755307f952248b83b7130d57d97c20a96669

comment:34 Changed 6 years ago by Federico M Pouzols

This seems to be working decently well now. About the three questions above:

1) How do we support the old-style plot options. For example error_bars, etc.

Old-style plot options have been included as kwargs, and it definitely seems the best option. This includes 'error_bars' (same name and behavior), and 'window' and 'clearWindow', which are now translated into the more matplotlib-ish hold and figure kwargs.

2) What about spectrum numbers (indicies)?

Spectrum indices are positional arguments. There doesn't seem to be any sensible default value.

3) What about the repeated multi-line format?

Multi-line format is supported. The plot marker control can be done with qti and is currently working well.

comment:35 Changed 6 years ago by Federico M Pouzols

A new Python module has been added that provides a first prototype of a new interface for plotting from the Python command line.

To see what the module does, you can do the following in the python script interpreter:

from mantidplot.future.pyplot import *
help(mantidplot.future.pyplot)

Or alternatively check the documentation at the beginning of file (https://github.com/mantidproject/mantid/blob/feature/8912_CLI_new_branch_to_solve_conflicts' into develop /Code/Mantid/MantidPlot/mantidplot/future/pyplot.py)

The modifications and additions done concern multiple layers. The new module, future.pyplot uses mantidplot, which relies on the sip bindings of qti (partially exposing the c++ classes and methods of qti and also qwt). Since the traditional mantidplot does not provide all the required functionality, future.pyplot also (mostly) uses the sip bindings of qti directly. For this, new methods and classes have been exposed in the bindings of qti (https://github.com/mantidproject/mantid/blob/master/Code/Mantid/MantidPlot/src/qti.sip). Because some parts of these layers are not fully documented/developed/tested, there are different naming conventions, etc. this can get a bit complicated and time consuming. New (develper) documentation will be added as work on this moves forward (I'd add a ticket about this, as it would save lots of time in the future/for others). Edit: ticket added as #10553.

To test:

  • This new module is meant to be tested by users so that we get quick feedback. Please keep this in mind and see how we could make it as accessible and clear as possible (documentation, interface, etc.)
  • As this is experimental stuff, any feedback is very much welcome!
  • Check that the tests pass (there's a new unit test for this new CLI): MantidPlotFuturePyplotGeneralTest.
  • Check the module documentation and and try to point out any possible issues and/or suggest improvements.
  • Check the documentation of the main methods and functions (those listed in the module doc).
  • Check code changes.
  • Check that it works well on your platform. Besides the tests, you can use the commands included in the documentation of the module and/or variations of them. Play with the new plot command and see if it works and makes sense.

Issues that I'm aware of:

  • disabling plot grids doesn't seem to be supported in qti. This may be relatively simple to add but requires modifications in qti, which is something that I think we definitely want to avoid, at least in this ticket.
  • Detailed error checking sometimes happens inside the 'traditional mantidplot' layer (this was ticket #8419). Maybe some checks should be done in future.pyplot, for better handling of ambiguous incorrect calls, but I've preferred to avoid code duplication and possible mix up of two separate tickets. If we try to improve this, I think it should be a separate issue/ticket once this and 8419 are merged.
  • the previos point implies that sometimes plots are shown even if they cannot be finished (the style specified cannot be fully applied, etc.). I see pros and cons in this. Do we want to show a plot even if future.pyplot was not able to apply a certain line style? matpotlib behaves a bit like this.
  • there are subtle (or not so subtle) differences in the way line styles are applied by this module, pylab and matlab. For example, in matlab if you specify as style string only a marker, it won't draw lines, just markers. Here you will get normal (solid) lines with markers. I haven't been picky in fully mimicking the behavior of matlab or pyplot, and would wait to see if users have something to say/request before making decisions and putting effort on this kind of details.
  • I'm not sure if it's a good idea to provide positional linestyle arguments (like in plot(x, y, 'r') ). It has advantages for multi-plot commands but I'd say that if we sticked to kwargs only we'd get a cleaner interface. Let's see if we get feedback on this.
Last edited 6 years ago by Federico M Pouzols (previous) (diff)

comment:36 Changed 6 years ago by Federico M Pouzols

Just as a brief note about possible ways of growing future.pyplot in the future. When you want to provide extensive support for different properties of plots, you quickly run into an explosion of functions, methods, classes, etc. In principle there would be three main (non-exclusive) possible alternatives:

comment:37 Changed 6 years ago by Federico Montesino Pouzols

add assertEqual in plot MD test, re #8912

Changeset: b89e0945f0d9f3c73126b27fd8b5626c18544790

comment:38 Changed 6 years ago by Federico Montesino Pouzols

avoid use of axes() on workspaces that don't have it, re #8912

Changeset: fdf6136eb1780f754e54f147cb992e6d625c9ca1

comment:40 Changed 6 years ago by Owen Arnold

refs #8912. Start work looking at pyplot.plot.

Changeset: bcdc6bb96759afdc3f1037d263a207f6a5a1f34d

comment:41 Changed 6 years ago by Owen Arnold

refs #8912. Remove mantidplot.py

Conflicts:

Code/Mantid/MantidPlot/mantidplot.py

conflict when removing Code/Mantid/MantidPlot/mantidplot.py, it should just go away

Changeset: 3ba9c9cfca9aede3d02f221d5e8d35d1e1d081fe

comment:42 Changed 6 years ago by Owen Arnold

refs #8912. Array to workspaces

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

issues with indentation and new (Future) test

Changeset: e1c233e04e3eba9b47d155b9e99826dea0e73005

comment:43 Changed 6 years ago by Owen Arnold

refs #8912. Add doc strings

This is not yet complient with the matplotlib pyplot plot function. That will be the next step.

Changeset: 7ba73fe5472365352bd3f123dc7ba0928d91af5d

comment:44 Changed 6 years ago by Owen Arnold

refs #8912. Common create workspace code.

Changeset: d82aca392d29bda1c683961324c36e641af52d73

comment:45 Changed 6 years ago by Owen Arnold

refs #8912. Down to args and kwargs.

Changeset: afe74b798c50c75569e42bf656911f7788b07236

comment:46 Changed 6 years ago by Federico Montesino Pouzols

Expose (basic version of) QwtPlotCurve through SIP binding, re #8912

Changeset: fe92e12b362935169d3be86ffdc6505766a25738

comment:47 Changed 6 years ago by Federico Montesino Pouzols

clarify what type means in the doc of plotSpectrum, re #8912

Changeset: 8ffb7d6cadf8a584639826beb31f5ab6dcc22c42

comment:48 Changed 6 years ago by Federico Montesino Pouzols

Expose QwtData so we can get lines' x andy data, re #8912

Changeset: a545cfb3bf537c0af736eb90552743a251d178b2

comment:49 Changed 6 years ago by Federico Montesino Pouzols

A bit of doc, and many methods into dir re #8912

Changeset: ce404eaef23474a286777841fb38d8c0a80719d4

comment:50 Changed 6 years ago by Federico Montesino Pouzols

First decent version of new CLI, still some TODOs, re #8912

Changeset: def24ada4d67fe298cc0565690126d0c6bad73da

comment:51 Changed 6 years ago by Federico Montesino Pouzols

comment:52 Changed 6 years ago by Federico Montesino Pouzols

Some more methods shown thru dir re #8912

Changeset: d897e2c733ad7e9201e221942b477fa5263cb8cc

comment:53 Changed 6 years ago by Federico Montesino Pouzols

comment about 'hold', re #8912

Changeset: d27564e3f4690ef626bb6b697277069c1e5607e8

comment:54 Changed 6 years ago by Federico Montesino Pouzols

Check minimum inputs with tool=..., re #8912

Changeset: 85ef86255b870f6f1b4c9e400fbbfccb88dcc048

comment:55 Changed 6 years ago by Federico Montesino Pouzols

Note about the size_t issue, re #8912

Changeset: 11ccb4f99a36cee54d2edd3b3154be93c77bf5d3

comment:56 Changed 6 years ago by Federico Montesino Pouzols

New unit test for future.pyplot, re #8912

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

indentation and conflict between InputArgs and FuturePyplot tests (both should stay there)

Changeset: 7e86b12736ffc7823a1456efddf2b01a877d2447

comment:57 Changed 6 years ago by Federico Montesino Pouzols

Figure class, better doc, re #8912

Changeset: 758d952e52e1c282d8106ac74a5133eb91329d0d

comment:58 Changed 6 years ago by Federico Montesino Pouzols

test multi-plot commands, and MD plots, re #8912

Changeset: 8d5ca4a3be695ad084ae4666cd1ad2bde5c0c28f

comment:59 Changed 6 years ago by Federico Montesino Pouzols

doc improvements and handling of multi-plot commands, re #8912

Changeset: 72cbf01fcabfdfb567a53402cbcaa87697ca9911

comment:60 Changed 6 years ago by Federico Montesino Pouzols

also check the x/y data in the lines returned by plots, re #8912

Changeset: 1f15c374ba3a2cdb489d84563be1e90f94ac29e5

comment:61 Changed 6 years ago by Federico Montesino Pouzols

more tests for different args, kwargs, re #8912

Changeset: 591ab13abbec00552ffc50c77fbdb60d142fe2a5

comment:62 Changed 6 years ago by Federico Montesino Pouzols

doc improvements, error_bars, hold, multi-plots back in, re #8912

Changeset: eda8c2a83e1135bacb105baf3b073c9bded2d6e7

comment:63 Changed 6 years ago by Federico Montesino Pouzols

proper MD test, and use assertEqual when possible, re #8912

Changeset: fae99bfcf6c6d9d07f8713c907f370fd15d34c53

comment:64 Changed 6 years ago by Federico Montesino Pouzols

better input checks, fixed multi-plot, re #8912

Changeset: e11a6e69f5bb67e5f22f204c6f12fe50199f64bc

comment:65 Changed 6 years ago by Federico Montesino Pouzols

fix conflict issues, re #8912

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

issue with the future/ files

Changeset: d22712538087a637835fe0eee13485f907aa58b7

comment:66 Changed 6 years ago by Federico Montesino Pouzols

add assertEqual in plot MD test, re #8912

Changeset: 2e5ee42b26413e8a872aa0905c43bbedb794b24b

comment:67 Changed 6 years ago by Federico Montesino Pouzols

avoid use of axes() on workspaces that don't have it, re #8912

Conflicts:

Code/Mantid/MantidPlot/mantidplotpy/init.py

no real conflict

Changeset: fbd28cfbefa9597b0de2a20ca20a998430d96b28

comment:68 Changed 6 years ago by Federico Montesino Pouzols

Trying to sort out what was lost during the cherry-picking conflicts, re #8912

Changeset: 93f7b9887520cf83789ff49ee3bc8ec5544d7808

comment:69 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI_new_branch_to_solve_conflicts' into develop

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

rename copy_python_files_to_dir => copy_files_to_dir re #8912

Changeset: 0a872b5511fc11fbc418886e8d356e006420ab1d

comment:70 Changed 6 years ago by Federico M Pouzols

  • Blocked By 10015 added

Added 10015 as a blocker. In that ticket a cmake function has been renamed (copy_python_files_to_dir => copy_files_to_dir) that creates conflicts with this ticket either in the develop or master branches.

comment:71 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI_new_branch_to_solve_conflicts' into develop

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

rename copy_python_files_to_dir => copy_files_to_dir re #8912

Changeset: 9051792fc79f791d13ff4619b883aba9a188a622

comment:72 Changed 6 years ago by Federico Montesino Pouzols

typedefs for size_t in WIN and non-WIN, re #8912

Changeset: b24db5f39d4364a31afa784c074e6354c247db82

comment:73 Changed 6 years ago by Federico Montesino Pouzols

Bring back changes lost in conflicts, re #8912

This fixes an issue in MantidPlot1DPlotTest which luckily reveal the loss of some chunks

Changeset: 37882e2d848d761b5fb90c3d244bfa1a195b981b

comment:74 Changed 6 years ago by Federico Montesino Pouzols

typedef unsigned int size_t out, crashes on linux, re #8912

Changeset: 118489b047f3b2d6333dd7bab18531ddce2983b1

comment:75 Changed 6 years ago by Federico M Pouzols

  • Owner changed from Owen Arnold to Federico M Pouzols
  • Status changed from inprogress to verify
  • Resolution set to fixed
  • Tester set to Owen Arnold

Ok, I think that this ticket is now ready for reviewing and testing. After a long series of conflicts it seems to be working fine in the develop branch. I also merged with master so hopefully there won't be conflicts there.

Testers and others, please scroll up to comment 35 (http://trac.mantidproject.org/mantid/ticket/8912#comment:35) for an explanation and instructions.

comment:76 Changed 6 years ago by Owen Arnold

  • Status changed from verify to verifying

comment:77 Changed 6 years ago by Federico Montesino Pouzols

Solve conflicts master/develop, re #8912

Changeset: 4ee6f8113c43c441604808aef7d22a19650c0a4d

comment:78 Changed 6 years ago by Federico Montesino Pouzols

Solve more conflicts master/develop, re #8912

Changeset: 17897a010e88f22416068cae803b02fb85ebcd0d

comment:79 Changed 6 years ago by Federico Montesino Pouzols

mantidplot dir renamed to pymantidplot, avoid name conflict, re #8912

Changeset: fd5bfe0b1715d5849e8b0fd2bcd20ac1a257a48d

comment:80 Changed 6 years ago by Federico Montesino Pouzols

update doc and tests to pymantidplot, avoid name conflict, re #8912

Changeset: a74a1eef61710480569620a80b4613ea298a6665

comment:81 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI_new_branch_to_solve_conflicts' into develop

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

Usual conflict with mantidplot / pymantidplot names and indents, re #8912

Changeset: 76da36354c1a6a996a274439b42f8436d0224851

comment:82 Changed 6 years ago by Federico Montesino Pouzols

update doc, new module pymantidplot name re #8912

Changeset: b939cf06443f731f00c03cccbc6b920fb1d0518c

comment:83 Changed 6 years ago by Federico Montesino Pouzols

add from... import * for proper init, re #8912

Changeset: be01bca66a7178b6e6acfd6d88596db2f37e11ff

comment:84 Changed 6 years ago by Federico Montesino Pouzols

mantidplot -> pymantidplot, re #8912

Changeset: 74df6da3ab7d3e6f595c6b6f3e9875b100e6a833

comment:85 Changed 6 years ago by Federico Montesino Pouzols

Also needs mantidplot -> pymantidplot, for proxies, re #8912

Changeset: e3f37613ebedeeca62e358ebd0c0c0b6d950c311

comment:86 Changed 6 years ago by Federico Montesino Pouzols

install fake mantidplot.py, re #8912

Changeset: 9ccabfb50bb22441f0009fd21c648c8b0646201a

comment:87 Changed 6 years ago by Federico Montesino Pouzols

added gpl header, re #8912

Changeset: 9c76a8a454d88a0b73a729e2c1a39802bd2633ed

comment:88 Changed 6 years ago by Federico Montesino Pouzols

rename mantidplotpy -> pymantidplot, re #8912

Changeset: d2edd782556a9f04cb49cdcc0170ba01084913ac

comment:89 Changed 6 years ago by Federico Montesino Pouzols

Get rid of windoze warning (size_t - unsigned int), re #8912

Changeset: 0e18d8944e96d2550079b227f3451be2194e049b

comment:90 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI_new_branch_to_solve_conflicts' into develop

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

rename copy_python_files_to_dir => copy_files_to_dir re #8912

Changeset: 9051792fc79f791d13ff4619b883aba9a188a622

comment:91 Changed 6 years ago by Federico Montesino Pouzols

Solve more conflicts master/develop, re #8912

Changeset: 17897a010e88f22416068cae803b02fb85ebcd0d

comment:92 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'feature/8912_CLI_new_branch_to_solve_conflicts' into develop

Conflicts:

Code/Mantid/MantidPlot/CMakeLists.txt

Usual conflict with mantidplot / pymantidplot names and indents, re #8912

Changeset: 76da36354c1a6a996a274439b42f8436d0224851

comment:93 Changed 6 years ago by Owen Arnold

We found some minor issues.

  • Log axis scales are needed. This is commonly used a a lot of techniques
  • Getting and using figure numbers. The following script reports negative figure numbers? This should be fixed but not documented.
  • Documentation for the module should highlight that it is subject to change as a 'future' import.
  • I can't do '--r' or '.r'. The former gives a solid line. the latter fails to work
  • You seem to need to specify workspaces and values as list types if you are using the repeated syntax. Not a major issue, but not documented either.
  • Keyword arguments with some things in 'plot', like title, which are also functions in their own right. Some things like x-axis title are not, but are functions. The behaviour should be consistent.
  • Add documentation for how to use hold="on" and hold="off"
from pymantidplot.future.pyplot import *

ws = CreateWorkspace([1,2,3], [1,2,3])

lines = plot([ws], [0], '--r', [ws], [0], 'g')
lines = plot([ws], [0], 'r', [ws], [0], 'g')
title('myplot_1')
xlabel('x')
figure(0)
title('myplot_0')
xlabel('x')
print dir(lines[0])
Last edited 6 years ago by Owen Arnold (previous) (diff)

comment:94 Changed 6 years ago by Owen Arnold

When closing the ticket add a important to test section against 3.3 about this http://www.mantidproject.org/Unscripted_Manual_Testing

comment:95 Changed 6 years ago by Owen Arnold

  • Priority changed from major to critical
  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:96 Changed 6 years ago by Owen Arnold

Code looks good. I've checked that plotSpectrum, plotBins and plotMD still work as expected.

comment:97 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from reopened to inprogress

doc: fixes, emphasize changes, explain hold='on', re #8912

Changeset: e04977304289bd6780e541a67eb5f7689782ede8

comment:98 Changed 6 years ago by Federico Montesino Pouzols

new Axes class, xlim, ylim, xscale, yscale, etc. re #8912

Changeset: fcb95ac5c8dccfd0cd55d040212e58721f0f2b63

comment:99 Changed 6 years ago by Federico Montesino Pouzols

re-fix apply linestyles from style strings. re #8912

Changeset: 79af94411de237a561febd184ff23334079b1f49

comment:100 Changed 6 years ago by Federico Montesino Pouzols

doc about set_ylabel, etc for Axes objects. re #8912

Changeset: 9882b4f47b2075a126dfb7a55cdd3e250b58c564

comment:101 Changed 6 years ago by Federico Montesino Pouzols

improve doc, fix minor issues, hide array workspaces. re #8912

Changeset: 67386c656d2029f58de0e736de028ab63db5e77f

comment:102 Changed 6 years ago by Nick Draper

Move all SSC tickets to critical by default

comment:103 Changed 6 years ago by Federico Montesino Pouzols

Figure.savefig, and final fixes for array args. re #8912

Changeset: 39a58116528d68e7137379bc0577d23181a65c4f

comment:104 Changed 6 years ago by Federico M Pouzols

  • Status changed from inprogress to verify
  • Resolution set to fixed

Here's a summary of changes made. I think this is now much better polished for end users. I'm also attaching a script that can be used to beta test different sets of functions/methods.

  • it has been emphasized that the module is subject to change, in the doc, and the message shown when the module is imported
  • some old matlab style style strings were not correctly parsed, this is now fixed.
  • workspaces and values are not required as vectors. This seems to be working, it must have been a consequence of the issue with style strings in multi-plot lines
  • the module documentation includes now an example that uses hold=on
  • the 'keyword arguments for additional plot details like axis title, etc.': Now I remember why this wasn't added initially. These options are not really supported as keywords in the plot functions of matplotlib. I've added a new class (Axes) with methods for those plot options (xlabel, xtitle, xlim, xscale, etc.). This is more in line with matplotlib. The Axes class is a minimal replica of the matplotlib equivalent. An example of how you use Figure and Axes:
        lines = plot(ws, 0)
        fig = lines[0].figure()
        all_ax = fig.axes()
        ax = all_ax[0]
        ax.set_xscale('log')
    
  • to support the log/linear scale there's now two new functions: xscale, yscale (which take 'log' or 'linear' argument), and the corresponding methods in the Axes class: set_xscale, set_yscale. For now, the Axes class takes care of keeping the scale status (which would need to be exposed from C++ / Graph).
  • for consistency between the functional and the OO interfaces, I've also added 'suptitle' and 'savefig' methods in the Figure class.

Changed 6 years ago by Federico M Pouzols

comment:105 Changed 6 years ago by Federico M Pouzols

  • Tester Owen Arnold deleted

This ticket has been already reviewed and tested. We decided to correct and improve a few points before passing it.

To finish testing:

  • check that this script (from comment:93) runs without errors:
    from pymantidplot.future.pyplot import *
    
    ws = CreateWorkspace([1,2,3], [1,2,3])
    
    lines = plot([ws], [0], '--r', [ws], [0], 'g')
    lines = plot([ws], [0], 'r', [ws], [0], 'g')
    title('myplot_1')
    xlabel('x')
    figure(0)
    title('myplot_0')
    xlabel('x')
    print dir(lines[0])
    
  • tests should pass
  • you could also double-check some of the example commands included in the attached script (already checked before).

Some parts of this ticket are tested in unit tests, other parts will be double-checked as part of the unscripted testing for the next release.

comment:106 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from verify to verifying
  • Tester set to Raquel Alvarez Banos

comment:107 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from verifying to closed

Merge branch 'master' into feature/8912_CLI_new_branch_to_solve_conflicts

Full changeset: 8d5a5ec8b73ee9ef606c102ca72e116c59946704

comment:108 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'master' into feature/8912_CLI_new_branch_to_solve_conflicts

Full changeset: 3df46ebb9c32196f2b2fee4e7e0d2bdb6bf6ca9c

comment:109 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'master' into feature/8912_CLI_new_branch_to_solve_conflicts

make sure conflicts are no longer there

Full changeset: 03c17e32624f6460e6ea901fbbd9660e9c5e5129

comment:110 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'master' into feature/8912_CLI_new_branch_to_solve_conflicts

trying to catch conflict in mantidplotpy

Full changeset: 490d8bb4557dd0ed618b04df9b8d2acf6aa8be19

comment:111 Changed 6 years ago by Raquel Alvarez Banos

Re #8912 Solving conflict

Changeset: dcd75066c6112be4f7679e54aea7389ee0b1eabc

comment:112 Changed 6 years ago by Owen Arnold

  • Blocking 10799 added

comment:113 Changed 6 years ago by Nick Draper

  • Keywords SSC,2014,All added; SSC removed

comment:114 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9755

Note: See TracTickets for help on using tickets.