Ambiente Plot

From FreeCAD Documentation
Jump to navigation Jump to search
This page is a translated version of the page Plot Workbench and the translation is 30% complete.
Outdated translations are marked like this.
Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎hrvatski • ‎italiano • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎română • ‎svenska • ‎čeština • ‎български • ‎русский • ‎中文 • ‎中文(中国大陆)‎ • ‎中文(台灣)‎
L'icona dell'ambiente Plot

Introduzione

FreeCAD is able to perform plots using the matplotlib Python library. A module is provided to this end, as an external add-on in version 0.19 and as a core component from version 0.20 on. Older versions of FreeCAD are not covered in this documentation.

The produced plots offer the standard matplotlib tools to edit and save. On top of that, a Workbench Plot.svg Plot Workbench is provided as an external add-on offering more complete tools to edit the plot and save it. The add-on can be installed with the Add-on manager.

Module

The module can be invoked in a Python console or in a macro. The first thing you must do is importing the module. In FreeCAD 0.19 you must first install the Workbench Plot.svg Plot Workbench using the Add-on manager, and then you can import Plot by typing:

from freecad.plot import Plot

Since FreeCAD 0.20 the plot module is already packaged with the program, so you don't need to install any add-on, but just type:

from FreeCAD.Plot import Plot

After that, you can plot a straight line from (0,0) to (1,2) just simply typing:

Plot.plot([0, 1], [0, 2])

You can find more complex examples in the Plot Basic tutorial and the Plot MultiAxes tutorial.

Strumenti

If you decide to install the Workbench Plot.svg Plot Workbench using the Add-on manager, you will have the following tools available to manage the plots created with the module:


  • Plot Save.svg Salva grafico: consente di salvare il grafico in diversi formati. È possibile selezionare il formato di output e anche la risoluzione.
  • Plot Axes.svg Assi: aggiunge, rimuove o modifica gli assi del grafico.
  • Plot Series.svg Serie: modifica il titolo e lo stile della serie.
  • Plot Grid.svg Griglia: mostra o nasconde la griglia.
  • Plot Legend.svg Legenda: mostra o nasconde la legenda.
  • Plot Labels.svg Etichette: edita le etichette.
  • Plot Positions.svg Posizioni: posiziona i vari elementi, come le etichette o la legenda.

Scripting

Script

Poiché il modulo Grafico è costruito su matplotlib, si è liberi di utilizzare tutti i comandi matplotlib per le istanze del grafico. Consultare la sezione Scripting and macros per vedere degli esempi.

Tutorial

Tutorial