Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This plot needs the creation of 3 Magics objects a magics. mmap to describe the projection and 2 axis to specify labels, ticks and other attributes. 

...

Section
Column
width350px

Column
width70%
Code Block
languagepy
titleAdvanced symbol plottingSetting the time series
collapsetrue
# importing Magics module
import Magics.macro as magics


# Setting of the output file name
output = magics.output(output_formats=['png'],
                output_name_first_page_number='off',
                output_name='odb_graph1')



# Define the cartesian projection
map = magics.mmap(subpage_map_projection = "cartesian",
                  subpage_x_axis_type = 'date',
                  subpage_y_axis_type = 'regular',
                  subpage_x_date_min = '2005-01-01',
                  subpage_x_date_max = '2010-12-31',
                  subpage_y_min = 0.,
                  subpage_y_max = 1000.,
                  subpage_y_position = 5.)
#define the axis
horizontal_axis = magics.maxis(axis_orientation = "horizontal",
                               axis_type = 'date',
                               axis_date_type = "automatic",
                               axis_grid = "on",
                               axis_grid_line_style = "solid",
                               axis_grid_thickness = 1,
                               axis_grid_colour = "grey",
                               axis_minor_tick ='on',
                               axis_minor_grid ='on',
                               axis_minor_grid_line_style = "dot",
                               axis_minor_grid_colour = "grey",
                               axis_title = 'on',
                               axis_title_text = "Time...",

                               )
vertical_axis = magics.maxis(axis_orientation = "vertical",
                               axis_grid = "on",
                               axis_grid_line_style = "solid",
                               axis_grid_thickness = 1,
                               axis_grid_colour = "grey",
                            )
#Add a text
title = magics.mtext(text_lines=['Preparing the time series'])

# Execute the plot.
magics.plot(output, map, horizontal_axis, vertical_axis, title)