Versions Compared

Key

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

...

Section


Column
width60%


Panel

Image Removed  msymb Image Addedmgraph ( macro/python ) psymb pgraph ( fortran )Symbol


Graph plotting in Magics is the plotting of

different types of symbols at selected locations.

A symbol in this context is a number (the value at the location), a text string (given by the user) or a Magics marker.

The Magics marker set contains classic markers such as dot, cross, square but also weather or clouds symbols.

An  advanced mode has beed added.

Using advanced mode means that the colour and height of the plotted symbols are determined automatically according to configurable rules.

line charts (curves), bar charts, area charts and box plots within a set of axes.

There are facilities in graph plotting that allow the user to control the line style, colour and thickness of each graph and, if required, a legend describing the graph may be plotted.


Panel
titleNew in 2.31.0

The parameter graph_bar_orientation is now working. If set to 'horizontal', Magics will display horizontal bars..

Image Added

Code Block
languagepy
titlePython Code
collapsetrue
#importing Magics module
from Magics.macro import *


ref = 'bar_horizontal'
#Setting of the output file name
output = output(output_formats = ['png'], 
        output_name_first_page_number = "off",
        output_name = ref)

#Setting the cartesian view
projection = mmap( subpage_y_position= 2., 
            subpage_map_projection = 'cartesian',
            subpage_x_axis_type = 'regular',
            subpage_y_axis_type = 'regular',
            subpage_x_min = 10.,
            subpage_x_max = 40.,
            subpage_y_min = 25.,
            subpage_y_max = 75.)

#Vertical axis
vertical = maxis(axis_orientation = "vertical",
                 axis_type = "regular",
                 axis_tick_label_height = 0.4,
                 axis_tick_label_colour = 'navy',
                 axis_grid =  "on",
                 axis_grid_colour = "grey",
                 axis_grid_thickness = 1,
                 axis_grid_line_style = "dot")

#Horizontal axis
horizontal = maxis(axis_orientation = "horizontal",
                 axis_type = "regular",
                 axis_grid =  "on",
                 axis_grid_colour = "grey",
                 axis_grid_thickness = 1,
                 axis_grid_line_style = "dot")
#define  the  data 
x =  numpy.array([20.,30.,15.])
y = numpy.array([50.,30.,40.])

input = minput(input_y_values=y,
           input_x_values= x,)
#Define the graph 
graph = mgraph( 
            graph_type="bar",
            graph_bar_colour='evergreen',
            graph_bar_width=2.,
            graph_bar_orientation='horizontal')
title = mtext(
           text_lines = ["Simple Bar"],
           text_justification = "left",
           text_font_size = 1.,
           text_colour =  "charcoal")
#To the plot
plot(output, projection, vertical, horizontal, input, graph, title)




Column
width30%


Panel
titleQuick links :

Import data:

Gallery:

 

 



 

 

HTML
<div id="magics">	
</div>

...


<script src="

...

/

...

download/attachments/13207038/magdoc.js"></script>
<link rel="stylesheet" type="text/css" href="

...

/

...

download/attachments/13207038/magics.css" />
<link rel="stylesheet" type="text/css" href="

...

/

...

download/attachments/13207038/jquery.miniColors.css" />

...

<link 

...

href="http://ajax.googleapis.com/ajax/libs/jqueryui/

...

1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="/download/attachments/13207038/jquery.miniColors.js"></script>

 <script>
	load("

...

/

...

download/attachments/

...

14157274/

...

graph.json");
</script>

...